Crestron simpl plus language ref 사용자 설명서

다운로드
페이지 374
Crestron SIMPL+
®
Software 
Language Reference Guide - DOC. 5797G
 SIMPL+
®
 
z 311
Compiler Error 1308
declaration error:  Global variable declaration cannot be 
declared in library file: '<identifier>'
I/O Declaration cannot be declared in library 
file: '<identifier>'
I/O declarations and global variables can only be defined in a SIMPL+ module (.usp 
file).  Libraries files (.usl files) are files that only contain functions.  Local functions 
variables, function arguments and function that return values are permitted within 
library files.
The following are examples of this error:
////////////////////////////////////////////////////////////
//////
//  MyLib.usl
INTEGER x;                              // error – x is global
STRING str[100];                        // error – str is global
DIGITAL_INPUT di;                       // error – di is global
FUNCTION MyFunc()
{
   INTEGER i, j;                        // ok – i and j are local
   STRING str[100];                     // ok – str is local
}
INTEGER_FUNCTION MyIntFunc( INTEGER x ) // ok – x is local
{
   INTEGER i, j;                        // ok – i and j are local
   STRING str[100];                     // ok – str is local
   return (x);
}
STRING_FUNCTION MyStFunc( STRING s )    // ok – s is local
{
   INTEGER i, j;                        // ok – i and j are local
   STRING str[100];                     // ok – str is local
   return (str);
}