Inline Functions
|
The commands which require a function as a parameter ie
IF, RUN, INT and KEY can have the function code embedded inside the
commands by enclosing the required code in square brackets. This allows you to reduce the number of lines of code for simple functions and where the function is unlikely to be used elsewhere. |
Syntax: [ cmd(..); cmd(..);.......cmd(..); ]
|
Options:
> IF( VarA op VarB ? [ CmdYA(); CmdYB(); ... CmdYn(); ] : [ CmdNA(); CmdNB(); ... CmdNn(); ] );
|
Examples://Without inline: KEY(keyFlr15,floor15fnc,104,84,TOUCH); //calls function floor15fnc FUNC(floor15fnc) { LOAD(vReqd,15); TEXT(txtCurFlr,"15");RUN(fncGo); } //With inline: KEY(keyFlr15, [ LOAD(vReqd,15); TEXT(txtCurFlr,"15"); RUN(fncGo); ],104,84,TOUCH); IF(VarA = 50 ? [CALC(VarA,VarA,5,"-");TEXT(TxtA,VarA);;] : [LOAD(RS2,"VarA=",VarA);SHOW(PageN);] ); KEY(keyX,[CALC(varX,varX,1,"+");],123,12,stKey); |