44 posts
Posted 01 October 2014 - 01:40 AM
I was testing out my new program and got this error message when I tried to run it:
bios:336 [string "ccts"]:59: 'end' expected (to close 'while' at line 2)
I checked the program, and all the end's looked in their right places, I'm stumped. Can someone tell me how to fix this? (ignore my placeholders of INSERT, that was for easy find and replace one i got computer ids)
file:
http://pastebin.com/UnVkVL8vTHANKS!
-graywolf69
1080 posts
Location
In the Matrix
Posted 01 October 2014 - 02:05 AM
Your While loop at line 2 does not have an end. And you're going to get a lot more errors from the program. Your if statements cannot have an end if there's an else/elseif after it such as
if a == z then
yay()
end --#Ends the if statement, and allows no else/elseif's
else --# Or else what? according to the program you've got nothing to do first.
nooo()
end
To properly do this and have it work you would put it like this
if a == z then
yay()
else
nooo()
end
Edited on 01 October 2014 - 12:05 AM
44 posts
Posted 01 October 2014 - 04:43 AM
Lol! Can't believe I didn't remember that thanks so much!
26 posts
Posted 03 October 2014 - 02:58 PM
Maybe you've fixed the paste by now but while does seem to have an end so I can't say what's wrong…
7508 posts
Location
Australia
Posted 03 October 2014 - 03:02 PM
Maybe you've fixed the paste by now but while does seem to have an end so I can't say what's wrong…
chances are they fixed the paste, because based on their answer they definitely know what was wrong and would have fixed it
1080 posts
Location
In the Matrix
Posted 03 October 2014 - 11:49 PM
Yes he did, however as a suggestion to him if he reads this again, your indentation is off by one since you should normally indent everything inside of a while loop :P/>
7508 posts
Location
Australia
Posted 04 October 2014 - 01:58 AM
Yes he did, however as a suggestion to him if he reads this again, your indentation is off by one since you should normally indent everything inside of a while loop :P/>
Indenting is a preference, not a requirement
1080 posts
Location
In the Matrix
Posted 04 October 2014 - 05:57 AM
Indenting is a preference, not a requirement
Yes however he had the rest indented so i was informing him that to help realize those errors, while loops would need indentation for everything within if he's trying to indent