Code: Select all
global gEditMode
global gTmpVals
function loadNameList
-- clear list
put empty in field "NameList"
-- repopulate NameList control
put the cardnames of this stack into field "NameList"
-- sort list
sort lines of field "NameList"
end loadNameList
on preStackOpen
-- set the initial state of the gEditMode variable to indicate that
-- initially the application is in read-only mode.
put false into gEditMode
-- ensure that the edit mode controls are hidden
hide button "SaveContact"
hide button "Cancel"
-- ensure that the read-only mode controls are visible
show button "CloseButton"
show button "EditContact"
-- load the names list (TBD)
call "loadNameList()" of this stack
end preStackOpen
Code: Select all
stack "AddressBook": execution error at line 27 (Handler: error in statement), char 1
Hmm, the code below works inline in the handler but not as a function...
Code: Select all
put the cardnames of this stack into field "NameList"
sort lines of field "NameList"
Code: Select all
+-------------------+
| card id 1002 |
| McKnight, Chuck |
| |
| |
| |
| |
| |
| |
+-------------------+
Progress?
I would appreciate any thoughts on how to isolate the reload list functionality into a stack-wide function so that I don't have to chase things like that all over the place.
Thanks in advance!
Charles