function meep(boolean b, int i) returns string
if i > 5
return "a"
if b
return "b"
else
return "c"
The function can be put inside jass into a loop, so the keyword exitwhen can be used to simulate returns inside the function to prevent further code execution:
function inlined takes nothing returns nothing
local integer i = 123
local boolean b = true
local string res
loop
if i > 5 then
set res = "a"
exitwhen true
endif
if b then
set res = "b"
else
set res = "c"
exitwhen true
endloop
//use res here
endfunction
This is just an idea, close this if it is pointless.
I will take this easy fuctions as example:
The function can be put inside jass into a loop, so the keyword exitwhen can be used to simulate returns inside the function to prevent further code execution:
This is just an idea, close this if it is pointless.