Help:VE273

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
 
Line 2: Line 2:
  
 
This error is reported by the [[TrainzScript]] compiler when a variable name is already in use in the current scope.
 
This error is reported by the [[TrainzScript]] compiler when a variable name is already in use in the current scope.
 +
 +
'''Example'''<br>
 +
In this example, the variable 'duplicateTest' is declared twice in the top-level function scope. The second declaration is illegal and will generate an error.
 +
 +
<nowiki>void TestFunction(void)
 +
{
 +
  int duplicateTest = 0;
 +
  int duplicateTest = 0;
 +
}</nowiki>
 +
 +
See also: [[Help:VE274|Error 274]]
 +
 +
[[Category:Validation Errors]]

Latest revision as of 11:46, 17 May 2024

Variable '<variable name>' already declared in this scope.

This error is reported by the TrainzScript compiler when a variable name is already in use in the current scope.

Example
In this example, the variable 'duplicateTest' is declared twice in the top-level function scope. The second declaration is illegal and will generate an error.

void TestFunction(void)
{
  int duplicateTest = 0;
  int duplicateTest = 0;
}

See also: Error 274

Personal tools