Jump to content




[error] EOF expected


  • You cannot reply to this topic
7 replies to this topic

#1 HurdeHack

  • Members
  • 27 posts

Posted 21 October 2012 - 03: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


#2 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 21 October 2012 - 03: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.

#3 HurdeHack

  • Members
  • 27 posts

Posted 21 October 2012 - 03:58 PM

Tnx for that i chanced the code
if key == 2 then
shell.run("worm")
end


#4 cheekycharlie101

  • Members
  • 231 posts

Posted 21 October 2012 - 04: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

#5 HurdeHack

  • Members
  • 27 posts

Posted 21 October 2012 - 04:02 PM

i tried that but then it still shows the error

#6 cheekycharlie101

  • Members
  • 231 posts

Posted 21 October 2012 - 04:57 PM

tell me what your trying to do and i may be able to help you

#7 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 21 October 2012 - 05:01 PM

View PostsIdEkIcK_, on 21 October 2012 - 03:51 PM, said:

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.

#8 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 21 October 2012 - 07:05 PM

View PostLyqyd, on 21 October 2012 - 05:01 PM, said:

View PostsIdEkIcK_, on 21 October 2012 - 03:51 PM, said:

--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.





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users