Functions can return lists

This commit is contained in:
2025-08-30 13:05:28 +10:00
parent f32f76450a
commit d8cc3ff9e0
2 changed files with 46 additions and 8 deletions

View File

@@ -17,3 +17,25 @@ endfun
call !jumpy &tmp
stdlnout "I called a function"
# This function returns a list
fun -list !dingus
stdlnout "Testing lists in functions"
setlist *dingle "heheheha" "hahahahe" "hmmm"
return *dingle
endfun
call !dingus *outlist
getlistsize *outlist &size
set &counter 0
@loopstart
equal $size $counter &cond
if $cond %loopend
getlistat *outlist $counter &tmp
stdlnout $tmp
add 1 $counter &counter
jump %loopstart
@loopend
end 0