|
![](/i/fill.gif) |
Finally! The finial comma vanished! I just declared comma_no before most of the other
stuff
and moved the line that subtracted one form comma_no to the outside of a #if
statement. I
think that the later is what fixed it.
Brendan Ryan Thank you Remco! :-)
Remco de Korte wrote:
> 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) |