Crestron SIMPL+
Language Reference Guide - DOC. 5797G
®
}
FUNCTION myFunc2( STRING sArg[10],
allowed
{
}
Compiler Error 1301
declaration error: Invalid array index
An index is required when accessing any element of an array. Two dimensional
arrays require both indices of the array to be specified. This index must be a valid
numeric expression.
All arrays are passed to functions by reference, so specifying an index in this case is
not allowed.
The following are examples of this error:
INTEGER xArr[10], x2dArr[10][20]; // ok
STRING str[100], strArr[50][100]; // ok
STRING_INPUT strIn[100];
STRING_OUTPUT strOut;
STRING str;
STRING_INPUT strIn;
BUFFER_INPUT bufIn;
STRING_OUTPUT strOutArr[10][20];
supported
STRING str[x];
allowed
STRING str[myFunc()];
INTEGER_FUNCTION MyIntFunc( INTEGER x[], INTEGER xArr[][] )
{
xArr[1] = 5;
xArr[1+2] = xArr[3+4];
xArr[1+xArr[2]] = xArr[xArr[3]];
xArr[MyIntFunc(xArr,x2dArr)] = 6;
x2dArr[1][2] = 6;
x2dArr[xArr[1]][xArr[2]] = x2dArr[xArr[5]][xArr[6]]; // ok
Call MyFunc( xArr, x2dArr );
xArr = 5;
xArr[] = 0;
xArr[str] = 6;
xArr[5][6] = 7;
STRING sArgArr[][] ) // error – 2-D strings not
// ok
// ok
// error – no length specified
// error – no length specified
// error – no length specified
// error – 2-D arrays not
// error – variables are not
// error – function calls are
//
// error – no index specified
// error – no index specified
// error - s is a STRING
// error – xArr is not a 2D array
Software
// error – size is not
//
supported
not allowed
// ok
// ok
// ok
// ok
// ok
// ok
®
SIMPL+
305
Need help?
Do you have a question about the SIMPL+ and is the answer not in the manual?
Questions and answers