EasyManua.ls Logo

Crestron SIMPL+ - Syntax Errors (Compiler Errors 1000 to 1013); Compiler Error 1000

Crestron SIMPL+
374 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Crestron SIMPL+
®
Software
Language Reference Guide - DOC. 5797G SIMPL+
®
z 289
Syntax Errors (Compiler Errors 1000 to 1013)
Compiler Error 1000
syntax error: '<identifier>' already defined
The specified identifier was declared more than once. A variable can only be
declared once within it’s function scope. The same identifier cannot be used for more
than one declaration type.
Scope refers to the level at which an Event, user-defined function or statement
resides. Having a global scope means that the function or variable can be called or
accessed from anywhere within the program. A local scope means that the variable
can only be accessed from within the event or function that it resides in.
The following are examples of this error:
INTEGER i;
INTEGER i; // error – i is already defined as an INTEGER
STRING i[100]; // error – i is already defined as an INTEGER
STRUCTURE myStruct
{
INTEGER i; // ok – i is a member variable of myStruct
}
INTEGER_FUNCTION MyFunc( INTEGER x, INTEGER y )
{
INTEGER i; // ok
INTEGER i; // error - i is already defined as a local
INTEGER
INTEGER x; // error – x is already defined as a function
// parameter, which makes it a local
// variable in this function
}
FUNCTION MyFunc() // error – MyFunc() is already defined
// as an INTEGER_FUNCTION
{
}
FUNCTION AnotherFunc( INTEGER x, INTEGER y ) // ok – x and y
are
// local to this function
{
}
NOTE: Make sure the identifier has not been declared as another declaration type,
user-defined function, or structure definition.

Table of Contents