Compiler Error 1501 - Crestron SIMPL+ Reference Manual

Language reference guide
Hide thumbs Also See for SIMPL+:
Table of Contents

Advertisement

Software
®
320
SIMPL+
Call AnotherFunc( 1 );
Call AnotherFunc( di ); // error – di is a DIGITAL_INPUT and
}

Compiler Error 1501

function argument error: Argument <arg_num> cannot be
In SIMPL+, arrays can only be passed by reference. The keyword, ByVal, cannot be
used within a function's argument list in conjunction with arrays. A copy of an
individual element within an array must first be copied into an INTEGER or STRING
variable and then that variable can be passed.
Pass by Reference – The function will act directly on the variable that was passed as
the argument. Any changes to the variable within the called function the will be
reflected within the calling function.
Pass by Value – The function creates a local copy of the source variable. Any
changes to this local copy are not reflected in the source variable that was originally
passed to the function. The source variable will still retains it's original value from
before the function was called.
The following are examples of this error:
FUNCTION MyFunc( ByVal INTEGER intArr[] )
cannot be
{
}
FUNCTION MyFunc( ByVal STRING strArr[] )
cannot be
{
}
FUNCTION MyFunc( ByVal INTEGER intArr[][] ) // error – arrays
cannot be
{
}
FUNCTION MyFunc( ByVal STRING strArr[][] )
cannot be
{
}
Crestron SIMPL+
// ok
//
cannot be passed
//
by reference
passed by value
// error – arrays
//
// error – arrays
//
//
// error – arrays
//
Language Reference Guide - DOC. 5797G
®
passed by value
passed by value
passed by value
passed by value

Advertisement

Table of Contents
loading

Table of Contents