Oxygen Basic

Information => Open Forum => Topic started by: Peter on October 08, 2011, 10:42:10 AM

Title: ExitFor
Post by: Peter on October 08, 2011, 10:42:10 AM
Deleted
Title: Re: ExitFor
Post by: Aurel on October 08, 2011, 12:25:11 PM
 :D
Which command EXITFOR or GOTO.
And by the way why you post this here on Oxygen Forum >:(
Title: Re: ExitFor
Post by: JRS on October 08, 2011, 12:36:09 PM
Quote
he has took  that evil GOTO

Is jmp evil in ASM?

Title: Re: ExitFor
Post by: Charles Pegge on October 08, 2011, 04:12:12 PM
jmp fwd is a little smarter the goto, since it restricts the direction of linkage and allows the same label name to be used more than once.

Code: OxygenBasic
  1.  
  2. xit:
  3.  
  4. '...
  5.  
  6. jmp fwd xit:
  7.  
  8. '...
  9.  
  10. xit:
  11.  
  12.  

The priority direction of linkage is backwards, so goto would send this code into a perpetual loop.

Charles

Oxygen supports exit for BTW
Title: Re: ExitFor
Post by: JRS on October 08, 2011, 06:12:19 PM
ScriptBasic uses GOTO to jump out of FOR/NEXT, GOSUB, ... and is smart enough to clean up on the way out.