|
![](/i/fill.gif) |
andrel <a_l### [at] hotmail com> wrote:
> Would you like to have arbitrary next item functions or just simply
> numeric increment?
I think arbitrary next-item functions are best.
If this is the example loop:
#declare Count=0;
#while (Count<MaxItems)
blah(Count)
#declare Count=Count+1;
#end // while (Count<MaxItems)
This form would be perfectly familiar to all the C users out there:
#for (Count=0; Count<MaxItems; Count=Count+1)
blah(Count)
#end // for (Count=0; Count<MaxItems; Count=Count+1)
Other languages are different, of course, but C seems to be "common ground".
I don't think assignments, comparisons, or statements can be passed as macro
arguments, but if they could be, something like this would almost work:
#macro for(init, check, inc, body)
#declare init
#while (check)
body
#declare inc
#end // macro for
>
> > And in
> > SDL in particular I think most loops I've ever seen were actually
> > counter-based loops (placing objects, subdivide angles, arrays).
That's what I've seen in other source files -- wish I had more experience, but
I'm still the new guy. :-P
Post a reply to this message
|
![](/i/fill.gif) |