just remember not to have multiple robots sending global to "#loadchars" at the same time.
a better option would be to have a way to distinguish between values.
"#loadchars"
set "oldcommands" "commands"
set "commands" "(-1>>1)"
:"loop"
if "$string('loop')&.char" != "" "#go"
inc "loop" 1
if "loop" < 10 "loop"
goto "#return"
:"#go"
set "&$string('loop')&.CHR" "fread_open"
set "fread_pos" "('ReadOffsetPosition_('loop')'*14)"
loop start
char edit "('OffsetPosition_('loop')'+'loopcount')" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread"
loop "('NumberOfChars_('loop')'-1)"
set "" "fread_open"
set "commands" "oldcommands"
set "$string('loop')" to ""
goto "#return"
That way, several robots could all get their work done, so long as they all appended a unique value from 0 to 10 at the end of their counters.
EDIT: ACTUALLY, not that I think about it, sending the global robot to a subroutine lable doesn't make the global robot actually spawn a subroutine, it'll just jump to that position, if you get to a "#return" lable it'll just return it not to the section it was taken from on the send... but to wherever a "#return" would have taken it BEFORE the global robot was sent to the subroutine lable...
I'm pretty sure this wouldn't work...
This post has been edited by Koji: 25 December 2006 - 06:20 AM