|
![](/i/fill.gif) |
Alan Grainger wrote:
>
> How do you exit from a macro? For instance, you have called a macro, and a
> certain condition is reached, and you want the macro to exit. How?
>
> #macro DoMacro ( a, b, c )
> blah blah...
> #if ( something = true )
> #endmacro
> #end
> more junk...
> #end
>
> Also, is there any way to goto somewhere?
>
> #macro DoMacro ( a, b, c )
> blah blah...
> here:
> blah blah...
> #if ( something = true )
> #goto here
> #end
> more stuff...
> #end
>
> Thanks for any help. :)
The easiest way I know of doing the first is placing the code inside a
#while loop with a simple switch. say
#macro DoMacro ( etc )
#local Switch = 0;
#while (Switch = 0)
#if ( something = true )
#local Switch = 1;
#end
#end
#end
As for the second, again placing sitches for various sections means that
instead of a literal goto, segments of the macro will be skipped. And if
you want to go backwards, intead of forwards, maybe the goto location
should be another macro in its own right.
--
regards
Nathan O'Brien
no1### [at] no13 net
http://www.no13.net
Post a reply to this message
|
![](/i/fill.gif) |