Help:VE273
From TrainzOnline
(Difference between revisions)
(Created page with "'''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 ...") |
|||
| (One intermediate revision by one user not shown) | |||
| Line 1: | Line 1: | ||
| − | '''Variable | + | '''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. | 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