|
![](/i/fill.gif) |
Andrea Ryan wrote:
>
> Now, the macro is nearly perfect. It can create whole prism statements but the part
that
> omits the comma after the last vector doesn't work. Here's the code: (which is
inside a
> while loop)
> Brendan Ryan
>
> #write (data, "","\n")
> #write (data, "",vec,"")
> #ifndef (comma_no)
> #local comma_no = sides;
> #end
> #if (comma_no>0)
> #write (data, "",",")
> #else
> #local comma_no = comma_no-1
> #end
>
I'm not sure how the rest looks but this seems a bit complicated.
How about this:
#write (data,"",vec,"")
#if (counter<sides)
#write (data, "",",")
#end
or something in that fashion.
Another solution, which also relates to your problem with closing the prism
could be:
#while (counter<sides)
// create a new vec for this value
#write (data,"",vec,"")
#write (data, "",",")
#end
#declare vec=first_vec;
#write (data,"",vec,"")
I hope this makes sense.
Don't look too much at the write-stuff, I just copied it from your example.
Good luck again :)
Remco
Post a reply to this message
|
![](/i/fill.gif) |