POV-Ray : Newsgroups : povray.advanced-users : passing variable to macro for use in #for statement : Re: passing variable to macro for use in #for statement Server Time: 19 Jan 2019 03:57:43 GMT
  Re: passing variable to macro for use in #for statement  
From: clipka
Date: 20 Sep 2018 15:00:09
Am 20.09.2018 um 16:09 schrieb Bald Eagle:

> Though I'm trying to only /initiate/ a loop with the macro - so the #end of the
> for loop is what I need to avoid at the present.
> I have not yet figured out if there's a syntax trick that's possible.

Can't do such a thing. The `#end` directives in a macro must always be
balanced - otherwise, how would the parser be able to figure out where
the macro ends.


>>     #declare Format = "png";
>>     image_map { FormatKeyword(Format) "foo.png" }
> 
> Right - o.  That'll be great.   Especially since I can just use a string
> function to look at the extension of the filename and avoid the declare
> altogether.   :)

If the file type can already be inferred from the extension, Why not let
POV-Ray do that job? Just leave out the file format keyword, like so:

    image_map { "foo.png" }

and Bob's your uncle.


Post a reply to this message

Copyright 2003-2008 Persistence of Vision Raytracer Pty. Ltd.