27 posts
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>' expextedi 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
2088 posts
Location
South Africa
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.
27 posts
Posted 21 October 2012 - 04:58 PM
Tnx for that i chanced the code
if key == 2 then
shell.run("worm")
end
214 posts
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
27 posts
Posted 21 October 2012 - 05:02 PM
i tried that but then it still shows the error
214 posts
Posted 21 October 2012 - 05:57 PM
tell me what your trying to do and i may be able to help you
8543 posts
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.
2088 posts
Location
South Africa
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.