Command INC
 
Description Include another menu, style or setup file in the current file. 7 levels of include are possible.
This command can be used to reference a file containing styles and commands on the SDHC card so that it’s contents are included at that point in the command process.
This enables modular design of the menu system.

The system does not recognize directory structures in the SDHC card.
Please put all active files in the root. All file names are 8 characters maximum length.
 
Syntax/Parameters INC(Source);
 
Options Text variable - v39.00
INC command accepts text variable (or pointer to text variable) for file name.

Maximum line length - v49.02
Maximum line length increased from 512 bytes to 8K bytes for include files.

Menu File Replacement Macro INC(''SDHC/file.mnu?find1=repl1&find2=repl2&...''); - v49.46
* Implemented functionality to include search/replace in included "mnu" files.
* INC("SDHC/file.mnu?find1=repl1&find2=repl2&...");
* Code looks for $find1$ (case insensitive) and replaces with repl1 etc.

If test.mnu contains:
VAR(var$name1$1Txt,"",TXT);
VAR(var$name1$2Txt,"$val2$",TXT);
VAR(var$name1$3Txt,"$invalid1$",TXT);
VAR(var$NAME1$4Txt,"$invalid2",TXT);
PAGE(pg$NaMe1$Main,stPage)
{
POSN($x$,$y$); TEXT(txt$name1$1,var$name1$3Txt,stTxt);
POSN(+0,+32); TEXT(txt$name1$2,var$name1$4Txt,stTxt);
}

then INC("SDHC/test.mnu?name1=Alpha&val2=Beta&x=99&y=99"); creates:

VAR(varAlpha1Txt,"",TXT);
VAR(varAlpha2Txt,"Beta",TXT);
VAR(varAlpha3Txt,"$invalid1$",TXT);
VAR(varAlpha4Txt,"$invalid2",TXT);
PAGE(pgAlphaMain,stPage)
{
POSN(99,99); TEXT(txtAlpha1,varAlpha3Txt,stTxt);
POSN(+0,+32); TEXT(txtAlpha2,varAlpha4Txt,stTxt);
}

and calling it again with INC("SDHC/test.mnu?name1=Delta&val2=Hello&x=199&y=149"); creates:

VAR(varDelta1Txt,"",TXT);
VAR(varDelta2Txt,"Hello",TXT);
VAR(varDelta3Txt,"$invalid1$",TXT);
VAR(varDelta4Txt,"$invalid2",TXT);
PAGE(pgDeltaMain,stPage)
{
POSN(199,149); TEXT(txtDelta1,varDelta3Txt,stTxt);
POSN(+0,+32); TEXT(txtDelta2,varDelta4Txt,stTxt);
}
 
 
Example INC( "SDHC/submenu.mnu" ); // specifies the file path on the SDcard.
INC( "NAND/menu2.mnu" ); // specifies the file path in the NAND.
INC( File1, File2, File3, ..., FileN ); // multiple files are possible
 
Update Information

 Version

 Title

Date  

 Details

49.46

 Menu File Replacement Macro INC(''SDHC/file.mnu?find1=repl1&find2=repl2&...'');

24 Oct 13 

Show

* Implemented functionality to include search/replace in included "mnu" files.
* INC("SDHC/file.mnu?find1=repl1&find2=repl2&...");
* Code looks for $find1$ (case insensitive) and replaces with repl1 etc.

If test.mnu contains:

VAR(var$name1$1Txt,"",TXT);
VAR(var$name1$2Txt,"$val2$",TXT);
VAR(var$name1$3Txt,"$invalid1$",TXT);
VAR(var$NAME1$4Txt,"$invalid2",TXT);
PAGE(pg$NaMe1$Main,stPage)
{
POSN($x$,$y$); TEXT(txt$name1$1,var$name1$3Txt,stTxt);
POSN(+0,+32); TEXT(txt$name1$2,var$name1$4Txt,stTxt);
}

then INC("SDHC/test.mnu?name1=Alpha&val2=Beta&x=99&y=99"); creates:

VAR(varAlpha1Txt,"",TXT);
VAR(varAlpha2Txt,"Beta",TXT);
VAR(varAlpha3Txt,"$invalid1$",TXT);
VAR(varAlpha4Txt,"$invalid2",TXT);
PAGE(pgAlphaMain,stPage)
{
POSN(99,99); TEXT(txtAlpha1,varAlpha3Txt,stTxt);
POSN(+0,+32); TEXT(txtAlpha2,varAlpha4Txt,stTxt);
}

and calling it again with INC("SDHC/test.mnu?name1=Delta&val2=Hello&x=199&y=149"); creates:

VAR(varDelta1Txt,"",TXT);
VAR(varDelta2Txt,"Hello",TXT);
VAR(varDelta3Txt,"$invalid1$",TXT);
VAR(varDelta4Txt,"$invalid2",TXT);
PAGE(pgDeltaMain,stPage)
{
POSN(199,149); TEXT(txtDelta1,varDelta3Txt,stTxt);
POSN(+0,+32); TEXT(txtDelta2,varDelta4Txt,stTxt);
}

49.02

 Include Files - Maximum line length increased from 512 bytes to 8K bytes for include files.

15 May 12 

Show

Maximum line length increased from 512 bytes to 8K bytes for include files.

49.00

 Rotary Encoder

22 Mar 12 

Show

Added rotary encoder function. It allows up to 2 encoders to be connected. The ports used for A/B can be any available I/O ports.
The rotary encoders available on the Accessories page allow a 10way IDC cable to control 2 encoders with center push switches.

SETUP(ENC)
{
active = 1/2/12; // N=none active, 1=enc1 active, 2 = enc2 active, 12 = both active
a1 = \\xx; // port number for enc1 A channel
b1 = \\xx; // port number for enc1 B channel
a2 = \\xx; // port number for enc2 A channel
b2 = \\xx; // port number for enc2 B channel
debounce1 = n; // debounce time in ms for enc1 (1 - 100ms)
debounce2 = n; // debounce time in ms for enc2 (1 - 100ms)
timeout1 = n; // timeout period in ms for enc1 (1 - 1000ms)
timeout2 = n; // timeout period in ms for enc2 (1 - 1000ms)
mode1 = n; // encoder type (1 or 2) for enc1
mode2 = n; // encoder type (1 or 2) for enc2
}

INT(name, ENC1/ENC2, fnc);
* System variables ENCVAL1 or ENCVAL2 are type S32 and hold the current count values for each encoder.
* LOAD(ENCVAL1,n); presets encoder variable value to required number n.
* The value of ENCVALn is decremented by the number of clicks left and incremented by the number of clicks right.
* Timeout specifies the time from the last rotation event until the INT is triggered.

39.00

 INC - INC command now accepts text variable (or pointer to text variable) for file name.

21 Jan 11 

Show

INC command now accepts text variable (or pointer to text variable) for file name.

35.00

 Multiple Level File Includes - Including menu files within other menu files is now supported.

12 Nov 10 

Show

Including menu files within other menu files is now supported. Multiple level nesting is supported.