Toolbox function implementation

From STX Wiki
< Programmer Guide‎ | Programming a Toolbox
Revision as of 17:31, 18 November 2010 by Admin (talk | contribs) (1 revision: Initial import)
Jump to navigationJump to search

Toolbox function implementation

The Toolbox function implementation takes place in a macro:

[MACRO tools]readvar #argv #function #argv /Dgoto cmd$#function noCmdnoCmd: exit
cmdFunction1:$@TBPARSE '$#argv'   // Parses the arguments depending on the context. This must be the first command$@TBLOADSETUP        // Loads the settings (if any are defined)/*... the function code ...*/$@TBSAVESETUP        // Save the settings (if any were changed)exit 1 int $#changed // #changed must be set to 1 if any data was changed (otherwise 0)

The function @TBPARSE must be the first command in the macro function. @TBPARSE and @TBLOADSETUP convert the calling arguments and the settings into local variables.

@TBPARSE

The Toolbox function @TBPARSE creates the following local variables:

#keyword The name of the calling context.
#function The name of the function which was called.

If a failure occurs when parsing, the Toolbox function is exited.

@TBLOADSETUP

The Toolbox function @TBLOADSETUP creates local variables for all setup variable definitions in the function definition. Every varname = varvalue entry is converted into a local variable #varname with the value varvalue. Setup variables can be saved using the Toolbox function @TBSAVESETUP. The setup variables are stored in the S_TOOLS-STx INI file.

@TBSAVESETUP

The Toolbox function @TBSAVESETUP saves all modified setup variables in the current S_TOOLS-STx INI file.

Navigation menu

Personal tools