Toolbox function implementation

From STX Wiki
Jump to navigationJump to search


The Toolbox function implementation takes place in a macro:

[MACRO tools]
readvar #argv #function #argv /D
goto cmd$#function noCmd
noCmd: 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 STx INI file.

@TBSAVESETUP

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

Navigation menu

Personal tools