-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel_HandlerCalls.livecodescript
More file actions
65 lines (56 loc) · 1.98 KB
/
Copy pathmodel_HandlerCalls.livecodescript
File metadata and controls
65 lines (56 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
script "model_HandlerCalls"
--> MetaData
-
license: GPLv3
name: model_HandlerCalls
type: model
version: 0.1
/*
Move to "lcw_Junk"???
A place for old hArray scripts.
We've now merged this library with "model_HandlerLibrary"
*/
--> Old | hArray | Calls | Model
-
/*
We can also get calls information from hArray
*/
function hkey_FetchShortCalls hKey, pReindex
-- first lets fetch a mainstack hArray
put item 3 of hKey into hObject
put the textStack_Folder of hObject into mainStackFolder
put mainStack_FetchHarray (mainStackFolder) into hArray
if hArray is not an array and pReindex is not false then
mainStack_ExportAsFiles hObject -- fix: should just redo hArray here
put the result into mainStackMetaArray
put mainStackMetaArray ["hArray"] into hArray
-- put mainStack_FetchHarray (mainStackFolder) into hArray
end if
-- found on disk from stack export
put hArray_GetCalls (hKey, hArray) into shortCalls
return shortCalls
end hkey_FetchShortCalls
function hArray_GetCalls hKey, hArray
put hArray_GetHandlerHash (hKey, hArray) into handlerHash
put hArray ["handlerHashArray"]["cached"][handlerHash]["shortCalls"] into shortCalls
return shortCalls
end hArray_GetCalls
function hArray_GetShortCalls hKey, pHArray
put hArray_GetHandlerHash (hKey, pHArray) into handlerHash
if handlerHash is not empty then
put pHArray ["handlerHashArray"]["cached"][handlerHash]["shortCalls"] into shortCalls
return shortCalls
else
-- not sure this option should be in this handler
return hkey_FetchShortCalls (hKey)
end if
end hArray_GetShortCalls
command hArray_SetShortCalls hkey, hArray, shortCalls
put hArray_GetHandlerHash (hKey, hArray) into handlerHash
if shortCalls is empty then
delete variable hArray ["handlerHashArray"]["cached"][handlerHash]["shortCalls"]
else
put shortCalls into hArray ["handlerHashArray"]["cached"][handlerHash]["shortCalls"]
end if
return shortCalls
end hArray_SetShortCalls