Stopping function exec

saw792

Is known to say things. That is all.
Reaction score
280
Say, for example, I have two functions like this:
JASS:
function Test2 takes nothing returns nothing
  <actions>
endfunction

function Test takes nothing returns nothing
  call Test2()
  <other actions>
endfunction


What actions can I put in Test2() that will end the execution of Test? Is this possible?

Don't ask why, it is quite complicated. You may see in an hour or so if this is solved.

EDIT: Okay maybe you won't see it today seeing as I ran into another problem as well.
 

Artificial

Without Intelligence
Reaction score
326
If it's okay for you to stop the whole thread (that means Test isn't called by anything that should run to its end), you could just e.g. use an uninitialized variable in Test2:
JASS:
function Test2 takes nothing returns nothing
  local integer i
  set i = i
endfunction
If you do need the function that called Test to run to its end, though, you should just make Test2 return a boolean and use an if:
JASS:
function Test2 takes nothing returns boolean
  return false
endfunction

function Test takes nothing returns nothing
  if Test2() then
    <other actions>
  endif
endfunction
 

saw792

Is known to say things. That is all.
Reaction score
280
Thanks Artificial, unitialised variable was what I was after.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top