Crestron SIMPL+
VARIABLE TYPE
STRING_OUTPUT array
STRING_OUTPUT array element
STRUCTURE
STRUCTURE element (INTEGER)
STRUCTURE element (LONG_INTEGER)
STRUCTURE element (SIGNED_INTEGER)
STRUCTURE element (SIGNED_LONG_INTEGER)
STRUCTURE element (STRING)
Language Reference Guide - DOC. 5797G
®
R: Read access allowed. W: Write access allowed.
(E1): Generates a RunTime Error, not allowed to be write to INPUT values. The
ReadOnlyByRef generates a compile error instead of a RunTime Error.
An example of a function declaration that has no parameters and returns no value
would be:
FUNCTION PrintText()
{
// Code
}
The following is an example of a function declaration that takes an INTEGER and
returns a STRING. The INTEGER is passed by value, so it cannot be modified.
NOTE: It is not strictly necessary to use the "ByVal" keyword here. ByVal can be
used to make sure that no modifications to the original variable are done by accident
within the function.
STRING_FUNCTION ComputeDate(ByVal INTEGER TheMonth)
{
STRING Month$[20];
// Code to compute Month$...
RETURN(Month$);
}
The following is an example of a function declaration that takes a STRING array and
sorts it and an integer that takes the actual number of elements that are contained in
the array. It returns an INTEGER error code:
INTEGER_FUNCTION SortNameInDatabase(STRING
Name[],INTEGER NumElements)
{
INTEGER Error;
// Code to sort Names[] and setError...
RETURN(Error);
}
ByVal
ByRef
[LOCAL
[SOURCE]
COPY]
-
-
-
-
-
R, W
R, W
-
R, W
-
R, W
-
R, W
-
-
-
Software
ReadOnlyByRef
[SOURCE]
-
-
R
-
-
-
-
-
®
SIMPL+
271
Need help?
Do you have a question about the SIMPL+ and is the answer not in the manual?
Questions and answers