so this ends the thread as inspected but does not end the loop my guess is that all things in the thread function is local only but what can i then do to update the "running" value in the global process aka in the while loop???
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
i don't know if this is even possible but what i am trying to do is this
NOTE: that is know that useing a thread in this scene is 100% Unnecessary but remeber this is a simple test
--------------------------------------------------------------------------------
thread = require "thread"
e = require "event"
running = true
t = thread.create(function()
e.pull("touch")
-- i know that i can put a os.exit() here but the thing is to try to get this to work
running = false --<< that
end)
while running do
--some random thing to run a io.read() will be a good combo
print( "you said: "..io.read() )
end
-----------------------------------------------------------------------------------------------
so this ends the thread as inspected but does not end the loop my guess is that all things in the thread function is local only but what can i then do to update the "running" value in the global process aka in the while loop???
all help will be great
--thanks
Link to post
Share on other sites