PML Customisation
User Guide
Commands
:
Callbacks or Events
: Execute
Execute
The Execute callback is called when the attached tool is clicked and optionally can be passed a single STRING argument !args[0] from the tool.
In its simplest form a button requires a simple callback to be executed.
define method .execute(!args is ARRAY)
show !!form
endmethod
If the button provides a string argument:
define method .execute(!args is ARRAY)
if (!args.size() gt 0) then
if (!args[0] eq 'EQUI') then
!!callback1()
elseif (!args[0] eq 'PIPE') then
!!callback2()
else
!!callback3()
endif
endif
endmethod
For a state button we can get the current state from the button using the checked() method:
define method .execute(!args is ARRAY)
!mode = !this.checked()
if (!mode) then
!!callbackA()
else
!!callbackB()
endif
endmethod
For a combo box we can get the selected item using the .selectedindex() method.
define method .execute(!args is ARRAY)
!this.setSpecification( !this.selectedIndex() )
Endmethod
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.