Page 1 of 1

breaking a thread

Posted: Fri Jul 13, 2007 4:56 pm
by c_los
I'm not sure if this would work:

Code: Select all

local.x = true
thread do_if_var_x_isnt_true local.x
...
do_if_var_x_isnt_true local.x
if(local.x)
  end
$player iprintln "local.x isnt true!"
end
Isn't there a way to break; out of a thread like in a c function?

Posted: Fri Jul 13, 2007 8:52 pm
by tltrude
That would probably work, but here is another way.

main:
local.x = "true"
thread do_if_var_x_isnt_true local.x
end

do_if_var_x_isnt_true local.x
:
if
!(local.x == "true")
$player iprintln "local.x isnt true!"
end


The little "!" symbol means "Not" or "Is Not". So, now it is saying, "If it is not true, do the next line." If it is true the next line will be skipped.

"break" can be used to stop a "while" loop.