Flow-control structures: Difference between revisions

m
No edit summary
Line 1,327:
long x=random(1, 2)
on x goto 90, 100
090 print "can print here if is "+x // if x=1
100 Print "ok"
gosub 500
alfa: // no statement here only comments because : is also statement separator
print "ok too"
integer c
Line 1,339:
}
print "no print here"
200 Gosub exitUsingGoto
Every 100 { // every 100 miliseconds this block executed
c++
Line 1,349:
on x gosub 400, 1234
}
if ok else print error$ // sub not found (display this message if x=2)
goto 1234 ' not exist so this is an exit from module
400 print "can print here if is "+x // if x=1
end
printc:
Print c
return
500 Print "exit from block using exit" : return
exitUsingGoto:
Print "exit from block using goto"
return
Line 1,363:
Inner
</syntaxhighlight>
 
 
 
=={{header|Mathematica}} / {{header|Wolfram Language}}==
404

edits