Using a PML Function in an Open Callback
- Last UpdatedFeb 08, 2023
- 1 minute read
All the examples so far have used form methods as open callbacks. The code would be essentially the same if we used PML Functions. The PML Function must be in a file of its own called control.pmlfnc. The body of the definition would be identical but must be bracketed by:
define function !!Control( !object is GADGET, !action is STRING)
. . .
endfunction
Note that the function has a global name !!control, that is, it is not a member of any form or object and thus cannot use the !this variable.
The open callback on the choose list gadget would become
list .choose callback '!!control(' multi width 15 height 8
The rest of the story remains the same.