This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
HurdeHack's profile picture

[error] EOF expected

Started by HurdeHack, 21 October 2012 - 02:43 PM
HurdeHack #1
Posted 21 October 2012 - 04:43 PM
im just typing for fun something but i still get the same error
bios:335: [string "spel"]:5: '<eof>' expexted
i dont know how to fix it heres the code

print("Spelletje doen? - druk op 1")
id, key = os.pullEvent("key")
until key == 2
if key == 2 then
shell.run("worm")
end
remiX #2
Posted 21 October 2012 - 04:51 PM
Not sure what you're trying to do, but the until line only is usable in a for loop.

For example:


for i = 1,100 do
  print(i)
until i == 52

This makes it do it until i is 52.
HurdeHack #3
Posted 21 October 2012 - 04:58 PM
Tnx for that i chanced the code

if key == 2 then
shell.run("worm")
end
cheekycharlie101 #4
Posted 21 October 2012 - 05:01 PM
i find that usally <eof> means there is an end somewhere that is unneeded. i surpose this means end of function or something but im not sure, try removing the end
HurdeHack #5
Posted 21 October 2012 - 05:02 PM
i tried that but then it still shows the error
cheekycharlie101 #6
Posted 21 October 2012 - 05:57 PM
tell me what your trying to do and i may be able to help you
Lyqyd #7
Posted 21 October 2012 - 06:01 PM
Not sure what you're trying to do, but the until line only is usable in a for loop.

For example:


for i = 1,100 do
  print(i)
until i == 52

This makes it do it until i is 52.

Have you actually done this and had it work? Because last time I checked, repeat/until and for/end weren't mix and match.
remiX #8
Posted 21 October 2012 - 08:05 PM
–snip

Have you actually done this and had it work? Because last time I checked, repeat/until and for/end weren't mix and match.

Woops, i meant repeat, not for. Fail.