Syntax Errors (Compiler Errors 1000 To 1013); Compiler Error 1000 - Crestron SIMPL+ Reference Manual

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

Advertisement

Crestron SIMPL+

Syntax Errors (Compiler Errors 1000 to 1013)

Language Reference Guide - DOC. 5797G
®

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.
NOTE: Make sure the identifier has not been declared as another declaration type,
user-defined function, or structure definition.
The following are examples of this error:
INTEGER i;
INTEGER i;
STRING i[100];
STRUCTURE myStruct
{
INTEGER i;
}
INTEGER_FUNCTION MyFunc( INTEGER x, INTEGER y )
{
INTEGER i;
INTEGER i;
INTEGER
INTEGER x;
}
FUNCTION MyFunc() // error – MyFunc() is already defined
{
}
FUNCTION AnotherFunc( INTEGER x, INTEGER y
are
{
}
// error – i is already defined as an INTEGER
// error – i is already defined as an INTEGER
// ok – i is a member variable of myStruct
// ok
// error - i is already defined as a local
// error – x is already defined as a function
//
parameter, which makes it a local
//
variable in this function
//
as an INTEGER_FUNCTION
Software
) // ok – x and y
// local to this function
®
SIMPL+
289

Advertisement

Table of Contents
loading

Table of Contents