Invalid statement syntax : DRAW_STATE++ Horseshoe Curve OR LOG
#1
Posted 08 March 2015 - 12:26 AM
I've got about a dozen of these warnings in the log for the Horseshoe curve:
Warning: sigscr-file line 581 : Invalid statement syntax : DRAW_STATE++
referring to the line in the dat file you find {
if (draw_state == 1 || draw_state == 4 || draw_state == 6 || draw_state == 8)
draw_state++;
}
Are these actually remarks? I'm wondering because parentheses are not used -- but instead these are used { ... I've forgotten the correct name.
Or is the phrase "draw_state++;" using incorrect syntax? Is this error affecting the signals? I'm finished and going to :p
Warning: sigscr-file line 581 : Invalid statement syntax : DRAW_STATE++
referring to the line in the dat file you find {
if (draw_state == 1 || draw_state == 4 || draw_state == 6 || draw_state == 8)
draw_state++;
}
Are these actually remarks? I'm wondering because parentheses are not used -- but instead these are used { ... I've forgotten the correct name.
Or is the phrase "draw_state++;" using incorrect syntax? Is this error affecting the signals? I'm finished and going to :p
#2
Posted 08 March 2015 - 02:37 AM
#3
Posted 08 March 2015 - 11:39 AM
#4
Posted 08 March 2015 - 12:21 PM
Hi Gerry,
try replacing
DRAW_STATE++;
with
DRAW_STATE = DRAW_STATE + 1;
and check if the problem disappears.
try replacing
DRAW_STATE++;
with
DRAW_STATE = DRAW_STATE + 1;
and check if the problem disappears.
#5
Posted 08 March 2015 - 03:29 PM
In C++, the expression C++ means the same thing as C = C + 1. It's programming shorthand, basically. It works in MSTS because of the way the scripts are interpreted. It doesn't work in OR because of the same reason.
Robert
Robert
#6
Posted 08 March 2015 - 10:54 PM
Thanks fellas, just finishing up for tonight, and thought I'd check the forum before turning in. Will apply corrections tomorrow. I have been trying to learn how to correct as many errors as possible.
This may not be true, but I've always thought the fewer errors there are the better the total experience. Every little thing adds up.
Running 2913 and OR just keeps getting better and better.
This may not be true, but I've always thought the fewer errors there are the better the total experience. Every little thing adds up.
Running 2913 and OR just keeps getting better and better.
#7
Posted 09 March 2015 - 06:33 AM
R H Steele, on 08 March 2015 - 12:26 AM, said:
I've got about a dozen of these warnings in the log for the Horseshoe curve:
Warning: sigscr-file line 581 : Invalid statement syntax : DRAW_STATE++
referring to the line in the dat file you find {
if (draw_state == 1 || draw_state == 4 || draw_state == 6 || draw_state == 8)
draw_state++;
}
Are these actually remarks? I'm wondering because parentheses are not used -- but instead these are used { ... I've forgotten the correct name.
Or is the phrase "draw_state++;" using incorrect syntax? Is this error affecting the signals? I'm finished and going to ;)
Warning: sigscr-file line 581 : Invalid statement syntax : DRAW_STATE++
referring to the line in the dat file you find {
if (draw_state == 1 || draw_state == 4 || draw_state == 6 || draw_state == 8)
draw_state++;
}
Are these actually remarks? I'm wondering because parentheses are not used -- but instead these are used { ... I've forgotten the correct name.
Or is the phrase "draw_state++;" using incorrect syntax? Is this error affecting the signals? I'm finished and going to ;)
I believe the "draw_state++;" bit is correct and will be accepted by OR, but the "if" is missing the curly braces {} around that statement. This is something OR doesn't support, we require the curly braces on all blocks even if only one statement is inside. (This is a difference from MSTS as far as I know.)
The following code should work IIUC:
if (draw_state == 1 || draw_state == 4 || draw_state == 6 || draw_state == 8) { draw_state++; }
#8
Posted 09 March 2015 - 11:05 AM
No, draw_state++ is not accepted. The '++' statement is not implemented.
Regards,
Rob Roeterdink
Regards,
Rob Roeterdink
#9
Posted 09 March 2015 - 12:05 PM
If Shirley MacLaine could teach me how to channel Adm. Grace Hopper I would have a slim chance of understanding what is going on. ;)
Actually, I'm keeping up okay. The original statement was completely enclosed by "curlies".... thus
{
if (draw_state == 1 || draw_state == 4 || draw_state == 6 || draw_state == 8)
draw_state++;
}
So does that leave us with changing the draw_state++; TO >> DRAW_STATE = DRAW_STATE + 1; ---after I get back from my daily cycling, that's what I'm going to do.
Thanks for the help.
Actually, I'm keeping up okay. The original statement was completely enclosed by "curlies".... thus
{
if (draw_state == 1 || draw_state == 4 || draw_state == 6 || draw_state == 8)
draw_state++;
}
So does that leave us with changing the draw_state++; TO >> DRAW_STATE = DRAW_STATE + 1; ---after I get back from my daily cycling, that's what I'm going to do.
Thanks for the help.
#10
Posted 09 March 2015 - 06:30 PM
Thanks for the help. Changing the syntax to draw_state = draw_state + 1; worked. Errors removed from log.