breaking a thread

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
c_los
Private
Posts: 7
Joined: Tue Jul 03, 2007 7:53 pm

breaking a thread

Post 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?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Post 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.
Tom Trude,

Image
Post Reply