|
Post by johnno56 on Oct 4, 2019 18:47:13 GMT -6
I am trying to convert an old Star Trek game that I made with SDLBasic.
I have a piece of code that RC just doesn't like...
sub AWA() Canvas(3)
' send an away team to mine the planet if shields <> 0 then prints("") prints(" You must lower your shields before the shuttle craft can depart.") wait(3000) else if nplanetsector = 0 then prints("") prints(" But Captian, there are no planets in the quadrant.") wait(3000) else for i = 0 to nplanetsector-1 if abs(planetx[i]-esx)<=1 and abs(planety[i]-esy)<=1 then e = rand(planete[i]) prints("") prints(" The away team has successfully mined " + str$(e) + " units of Dilithium.") prints(" You are being re-fueled and re-armed.") wait(3000) energy = energy + e planete[i] = 0 stardate = stardate + 0.5 exit sub '<<<<<<<<<<<<<<<<<<<<<<<<< end if next prints(" But Captian, we are not adjacent to a star with a planet.") wait(3000) end if end if end sub
"ERROR:Expected {DO | FOR | WHILE} in EXIT statement"
Is there a "work-a-round" that can solve this problem?
Any assistance would be appreciated. But, do not spend too much time on this issue, it's not a priority. Just seeing "If I can..." lol
|
|
|
Post by n00b on Oct 4, 2019 20:02:36 GMT -6
Hey johnno, just use RETURN by itself to exit subs.
|
|
|
Post by johnno56 on Oct 4, 2019 20:47:39 GMT -6
That loud sound you will probably hear would be the palm of my hand hitting my forehead... I was of the opinion that 'return' was only used in 'functions'... lol
I just tried it and the error was corrected... Many thanks... Now that the 'return' error is cleared... the floodgates opened to all the other minor typos... lol
J
|
|