exit a program?
#1
Posted 12 August 2014 - 03:04 AM
#2
Posted 12 August 2014 - 03:06 AM
error()
#3
Posted 12 August 2014 - 03:11 AM
CCJJSax, on 12 August 2014 - 03:06 AM, said:
error()
error()but... that's like an error. I know
shell.exit()but I have a while loop.
EDIT: o got it working, I just disabled the while loop. no need to use shell.exit() and/or error()
Edited by !!!!!!!!!!ExclaimationMark, 12 August 2014 - 03:13 AM.
#4
Posted 12 August 2014 - 03:14 AM
#6
Posted 12 August 2014 - 03:48 AM
#7
Posted 12 August 2014 - 04:30 AM
theoriginalbit, on 12 August 2014 - 03:48 AM, said:
function exit() -- exit thing end function loop() while true do -- do looping stuff end end loop()What should be in exit()? error()?
Edited by !!!!!!!!!!ExclaimationMark, 12 August 2014 - 04:31 AM.
#8
Posted 12 August 2014 - 04:35 AM
local continue=true function exit() continue=false-- exit thing end function loop() while continue do -- do looping stuff end end loop()and, unless you're accessing 'exit' outside of your program, I'd recommend using local functions
#9
Posted 12 August 2014 - 06:47 AM
while true do --main loop --stuff break --to exit, use the "break" keyword. it can be in an if statement end
Edited by flaghacker, 12 August 2014 - 06:48 AM.
#11
#12
Posted 12 August 2014 - 07:33 AM
flaghacker, on 12 August 2014 - 06:55 AM, said:
I mean:
function fn1() print("doSomething") end function fn2() fn1() fn3() end function fn3() -- Exit end function loop() -- the main program end loop()
#13
Posted 12 August 2014 - 10:37 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users