Crestron simpl plus language ref 사용자 설명서

다운로드
페이지 374
Software Crestron 
SIMPL+
®
268 
z SIMPL+
®
Language Reference Guide - DOC. 5797G
Function Parameters
Functions may contain a list of parameters that are passed by the caller. Typically, 
data is passed to a function in order to make the code readable, maintainable, and less 
prone to bugs. SIMPL+ Version 1.00 did not allow data to be passed to functions. The 
only way to get data into functions was to declare global variables and have the 
functions reference the global variables. 
The function argument list contains a comma separated list of arguments. The 
arguments are of the form:
[ByRef | ByVal] <INTEGER | LONG_INTEGER | SIGNED_INTEGER 
| SIGNED_LONG_INTEGER | STRUCTURE> <variable_name>
ByRef and ByVal are keywords telling the system the read/write permissions and 
local behavior for the variable in the function. They are discussed in the next section.
INTEGER, STRING or STRUCTURE tells the function the<variable_name> type. 
BUFFER_INPUT, STRING_INPUT, STRING_OUTPUT, and STRING 
declarations are passed into a function using the STRING type. All other types are 
passed using the INTEGER type.
The function refers to the passed variable as <variable_name>. Note that for a one-
dimensional array, the syntax is <variable_name>[] and for a two-dimensional array 
the syntax is <variable_name>[][].
 
NOTE: Passing STRINGs with BYVAL and BYREF is not allowed in the 2-Series 
Control System. All STRINGs are passed by referenced in the 2-Series Control 
System.
NOTE: Passing I/O datatype variables (DIGITAL_INPUT, ANALOG_INPUT and 
STRING_INPUT) is not allowed in the 2-Series Control System.