10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ScriptsExample—Field and Menu Item Event BlocksThe following event block for the salary field checks that the value in the fieldis below a specified maximum when the user leaves the field:on setvalue =beginif salary > 100000 thenCurFrame.InfoPopup(messagetext = 'Salary too high.',messagetype = MT_ERROR);resume;endif;end;The following sample event block executes when the user selects Close fromthe File menu:on click =beginreturn;end;User Class ScriptsA user class script contains methods that you can invoke to use with variablesdefined for a user class. The syntax for this type of script is:[initialize =declarelocalprocedureforwardreferencesenddeclare]{method methodname [([parameterlist])] =[declarelocalvariablelistenddeclarebeginstatementlistend [;]}{localprocedure[;]}methodnameIdentifies a method defined for the user class that the script uses. Youcannot define a method twice in a user class script. For more informationabout methods, see the Language Reference <strong>Guide</strong> online help.For more information about using methods in a user class script, see Workingwith Classes (see page 113).Writing Scripts and Procedures 73

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!