forked from ground/ground
Experimental function jumping
This commit is contained in:
@@ -1,14 +1,19 @@
|
||||
fun -int !dingle -string &silly
|
||||
stdlnout "This is inside the function"
|
||||
stdout "The function argument is "
|
||||
stdlnout $silly
|
||||
return 10
|
||||
fun -bool !jumpy
|
||||
stdlnout "This is the jumpy function"
|
||||
set &counter 0
|
||||
jump %inloop
|
||||
@jumpback
|
||||
stdlnout "Yay I jumped!"
|
||||
@inloop
|
||||
add 1 $counter &counter
|
||||
inequal 10 $counter &out
|
||||
stdout "Condition is"
|
||||
stdlnout $out
|
||||
if $out %jumpback
|
||||
stdlnout "Finished"
|
||||
return true
|
||||
endfun
|
||||
|
||||
stdlnout "This is outside the function"
|
||||
call !jumpy &tmp
|
||||
|
||||
pusharg "heheheha"
|
||||
call !dingle &var
|
||||
|
||||
stdout "Function returned "
|
||||
stdlnout $var
|
||||
stdlnout "I called a function"
|
||||
|
Reference in New Issue
Block a user