func init // initialize instance if(isdef("Extern")) sys.add_var(this.name, 1) else this.setfield('i', 'i' + this.id) end if(linked("doStop")) sys.add_var('stop', 104) end end func doFor(end_data, start_data) if(isdef("InData")) end_data = start_data = 0 end _end = d("End") _start = d("Start") if(linked("doStop")) blk.println(this.stop, ' = false;') end if(isdef("Extern")) blk.println('for (', this.codename, ' = ', _start, '; ', this.codename, ' <', isdef("IncludeEnd") ? '= ' : ' ', _end, '; ', this.codename, '++) {').inc() event("onEvent", this.codename) else blk.println('for (int ', this.i, ' = ', _start, '; ', this.i, ' <', isdef("IncludeEnd") ? '= ' : ' ', _end, '; ', this.i, '++) {').inc() event("onEvent", this.i) end if(linked("doStop")) blk.println('if (', this.stop, ') goto exit', this.id, ';') end blk.dec().println('}') if(linked("doStop")) blk.println('exit', this.id, ':;') end event("onStop") end func doStop() blk.println(this.stop, ' = true;') end func doBreak() if(linked("doFor")) blk.println('break;') end end func doContinue() if(linked("doFor")) blk.println('continue;') end end func Position return(isdef("Extern") ? this.codename : this.i) end