Elvas Tower: Invalid statement syntax : DRAW_STATE++ - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Invalid statement syntax : DRAW_STATE++ Horseshoe Curve OR LOG Rate Topic: -----

#1 User is offline   R H Steele 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 3,457
  • Joined: 14-March 13
  • Gender:Male
  • Location:known universe
  • Simulator:Open Rails
  • Country:

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

#2 User is offline   markus_GE 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 4,862
  • Joined: 07-February 13
  • Gender:Male
  • Location:Leoben, Styria, Austria, Europe
  • Simulator:ORTS / MSTS
  • Country:

Posted 08 March 2015 - 02:37 AM

View PostR H Steele, on 08 March 2015 - 12:26 AM, said:

[...] but instead these are used { ... I've forgotten the correct name.
[...]


Curly braces :p

Cheers, Markus

#3 User is offline   R H Steele 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 3,457
  • Joined: 14-March 13
  • Gender:Male
  • Location:known universe
  • Simulator:Open Rails
  • Country:

Posted 08 March 2015 - 11:39 AM

View Postmarkus_GE, on 08 March 2015 - 02:37 AM, said:

Curly braces :help:

Cheers, Markus


are those the same as Moe and Larry braces, "nyuk-nyuk-nyuk!", "woob-woob-woob!" :thumbdown3: :ermm:

#4 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,024
  • Joined: 31-December 11
  • Gender:Male
  • Country:

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.

#5 User is offline   rdamurphy 

  • Open Rails Developer
  • Group: Private - Open Rails Developer
  • Posts: 1,199
  • Joined: 04-May 06
  • Gender:Male
  • Location:Thornton, CO
  • Simulator:MSTS - OR
  • Country:

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

#6 User is offline   R H Steele 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 3,457
  • Joined: 14-March 13
  • Gender:Male
  • Location:known universe
  • Simulator:Open Rails
  • Country:

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.

#7 User is offline   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,492
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 09 March 2015 - 06:33 AM

View PostR 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 ;)

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 User is offline   roeter 

  • Vice President
  • Group: Status: Elite Member
  • Posts: 2,426
  • Joined: 25-October 11
  • Gender:Male
  • Country:

Posted 09 March 2015 - 11:05 AM

No, draw_state++ is not accepted. The '++' statement is not implemented.

Regards,
Rob Roeterdink

#9 User is offline   R H Steele 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 3,457
  • Joined: 14-March 13
  • Gender:Male
  • Location:known universe
  • Simulator:Open Rails
  • Country:

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.

#10 User is offline   R H Steele 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 3,457
  • Joined: 14-March 13
  • Gender:Male
  • Location:known universe
  • Simulator:Open Rails
  • Country:

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.

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users