Assignment Errors (Compiler Errors 1400 To 1402); Compiler Error 1400 - Crestron SIMPL+ Reference Manual

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

Advertisement

Crestron SIMPL+

Assignment Errors (Compiler Errors 1400 to 1402)

Language Reference Guide - DOC. 5797G
®

Compiler Error 1400

assignment error: Illegal Assignment
Assignments in SIMPL+ require that the value being assigned to a variable must
equate to the same type as that variable. Integer variables can only be assigned
integer values and string variables can only be assigned a string value.
If a complex assignment is being made, make sure that all parenthesis are matched.
In other words, all opening parenthesis must have a matching closing parenthesis.
When comparing 2 strings ('=', '<', '>=', etc.), the resulting value is an integer
Input variables (DIGITAL_INPUT, ANALOG_INPUT, STRING_INPUT and
BUFFER_INPUT) cannot be assigned a value.
The following are examples of this error:
INTEGER x, y;
STRING str[100], str2[100];
DIGITAL_INPUT digIn;
DIGITAL_OUTPUT digOut;
ANALOG_OUTPUT anlgOut;
FUNCTION MyFunc()
{
str = "abc";
str = "abc" + "def";
str = str2;
x = 1;
x = digOut;
x = (str = str2);
x = 5 * (1 + (str > str2)); // ok
digOut = x;
digOut = 5;
digOut = anlgIn;
x = str;
digIn = 1;
str = 5;
str = str2 = "abc";
equality
}
// ok
// ok
// ok
// ok
// ok
// ok
// ok
// ok
// ok – both are integer types
// error – str does not equate to
//
an integer
//
atoi() should be used
// error - digIn is an input variable
// error – 5 is an integer
//
MakeString() should be used
// error = str2 = "abc" is an
//
test, not an assignment
Software
®
SIMPL+
317

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SIMPL+ and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF