Clean script exit? - page 2 - Script Writing - CHDK Forum

Clean script exit?

  • 11 Replies
  • 3039 Views
*

Online reyalp

  • ******
  • 12164
Re: Clean script exit?
« Reply #10 on: 23 / June / 2009, 21:50:41 »
Advertisements
Missed my point or am I missing something?
I did indeed miss your point
Quote
Restore() only executed the first line of code and not the rest of the test script.
I don't see how that's possible, since lua doesn't know anything about lines by that point. The code you pasted isn't valid.

Code: [Select]
function restore()
print("Restore activated")
for i =1,5 do
print("fun")
end
n=0
end

n=1
while n==1 do
   sleep(1000)
   print("Sleeping!")
end
print("Script successfully terminated")
works as expected for me, spamming 5 "funs" before quitting.
Don't forget what the H stands for.

*

Offline Mac

  • *
  • 40
Re: Clean script exit?
« Reply #11 on: 24 / June / 2009, 09:19:31 »
Thanks All!
Obvious coding error on my part (missing "end" on loop).
Good catch.

 

Related Topics