FDO Looping
FDO supports controlled looping
a loop like so:
A = 0
DO WHILE A < 10
A = A + 1
Edit1.text = STR(A)
LOOP END
can be implemented in FDO as:
uni_start_stream ; start of fdo stream
var_number_set <a,0> ; set register A to 0
var_number_set <b,10> ; set register B to 10
uni_start_loop ; start of loop
if_numa_lt_numb_then <10> ; check if register a is less than register b when false jump to uni_sync_skip <10> below
var_numa_increment ; increment register a
man_set_context_relative <1> ; change display managers current object to id 1 (a text field - previous defined on the window
var_number_get <a> ; copy current value of register a to 'last' value
uni_convert_last_atom_string ; convert 'last' value to a string
uni_use_last_atom_string <man_replace_data> ; use the 'last' value as an input argment to man_replace_data
man_update_display ; update on screen results
man_end_context ; end change of display manager current object
uni_end_loop ; end of loop - returns execution to uni_start_loop
uni_sync_skip <10> ; label '10'
uni_end_stream ; end of fdo stream
so simple, no wonder...

0 Comments:
Post a Comment
Links to this post:
Create a Link
<< Home