Command |
Inline Functions |
|
|
Description |
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/Parameters |
[ cmd(..); cmd(..);.......cmd(..);
] |
|
|
Options |
> IF( VarA op VarB ? [ CmdYA(); CmdYB(); ... CmdYn(); ] : [ CmdNA(); CmdNB(); ... CmdNn(); ] );
>
RUN( [ CmdA(); CmdB(); ... Cmdn(); ] );
>
INT( Name, Buf, [ CmdA(); CmdB(); ... Cmdn(); ] );
>
KEY( Name, [ CmdA(); CmdB(); ... Cmdn(); ], X, Y, Style ); |
|
|
Example |
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);
Examples:
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);
|
|
|
Update Information |
Version |
Title |
Date |
Details |
49.58 |
INLINE FUNCTIONS |
07 Sep 15 |
|
* Now handles empty functions - []
|
|
49.44 |
Empty inline functions ''[ ]'' not supported |
10 Oct 13 |
|
Problem was found when an empty inline function appeared in a command []. For example: KEY(ky1,[],[LOAD(RS2,"U");],[LOAD(RS2,"R");],480,272,TOUCHC);
The error message "Command Error - Inline Func Too Short" was returned.
This is now fixed.
|
|
49.32 |
EXIT() - Corrected EXIT() operation when multiple commands exist on same line. |
14 Feb 13 |
|
* Corrected EXIT() operation when multiple commands exist on same line.
|
|
49.32 |
Commands over multiple lines - Commands can now be split over multiple lines to aid readability. |
14 Feb 13 |
|
* Commands can now be split over multiple lines to aid readability. Inline comments can also be incorporated. The closing ");" must be on the same line. * Restrictions: Inline functions [...] cannot currently be split over lines. * Examples: --- LOAD(RS2,"Hello",123,var); --- LOAD ( // comment RS2, // param 1 "Hello" // param 2 , // the separator 123, var // param 4 ); ---
|
|
30.00 |
Inline Command Blocks - enclosed in [...]'s - Commands that make calls to functions can now include the function code inline. |
24 Sep 10 |
|
Commands that make calls to functions (RUN, IF, INT,KEY) can now include the function code inline by enclosing commands in square brackets [] or call a function.
IF( VarA op VarB ? [ CmdYA(); CmdYB(); ... CmdYn(); ] : [ CmdNA(); CmdNB(); ... CmdNn(); ] );
RUN( [ CmdA(); CmdB(); ... Cmdn(); ] );
INT( Name, Buf, [ CmdA(); CmdB(); ... Cmdn(); ] );
KEY( Name, [ CmdA(); CmdB(); ... Cmdn(); ], X, Y, Style );
Examples: 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);
This reduces the number of lines in the file by almost 30% and keeps related code close to the action.
|
|
|
|