Quote Originally Posted by flotulopex View Post
Hello,
I can't find out why this doesn't work:
Code:
if mem_l = 2 then speed = speed + 1 : gosub game_speed
while this does:
Code:
if mem_l = 2 then speed =  1 : gosub game_speed
According to the PBP Compiler's manual, both syntax look okay.
When I run my prog with the second example, my Speed VAR will go crazy and show up numbers between 50 and 240(?). Speed is declared as VAR Byte and set to "0" at beginning of prog.
I've attached my code (the concerned lines are labeled 'Set game speed according to level).
Any help is appreciated.
You can't have a 'colon' in a single line if/then statement. You have to split it up, like this:

If mem_1 = 2 then
speed = speed + 1
gosub game_speed
EndIf

or

If mem_1 = 2 then
speed = speed + 1 : gosub game_speed
EndIf

I don't think the manual says it specifically, but that's the way it is.