Posted 01 July 2012 - 05:40 AM
I'm trying to make a basic menu for an install disk, and it was messing up. My code:
The error:
This code is in disk/startup
When I reboot the console with the disk in the drive, the above error occurs.
I made a simpler program to test this out:
Upon running this program ("readtest"), I get the following error:
I'm super new to Lua and programming in general, so any and all help is welcome.
Thanks!
function menu()
print("Welcome to the install disk for Test!")
sleep(2)
print("Would you like to install Test?")
t = read()
if t == "Yes" then
fs.copy("/disk/test", "/test")
end
if t == "No" then
error()
end
else
menu()
end
menu()
The error:
bios:206: [string "startup"]:16: 'end' expected (to close 'function' at line 1)
This code is in disk/startup
When I reboot the console with the disk in the drive, the above error occurs.
I made a simpler program to test this out:
function menu()
t = read()
if t == "Yes" then
print("Hello!")
end
if t == "No" then
error()
end
else
menu()
end
menu()
Upon running this program ("readtest"), I get the following error:
bios:206: [string "startup"]:9: 'end' expected (to close 'function' at line 1)
I'm super new to Lua and programming in general, so any and all help is welcome.
Thanks!