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
26 Apr 2024 17:59:40 EDT (-0400)
  Re: passing variable to macro for use in #for statement  
From: dick balaska
Date: 21 Sep 2018 00:51:03
Message: <5ba478b7$1@news.povray.org>
On 09/20/2018 02:56 PM, Kenneth wrote:

>
> This would be the (longer) way that I would write such a macro (just for
> visual/mental clarity):
>
> #macro FormatKeyword(Format)
> #if (Format = "png")
> png
> #else
>      #if(Format = "jpeg")
>      jpeg
>      #else
>           #if(Format = "bmp")
>           bmp
>           #else
>           #end
>      #end
> #end
> #end // of macro
>


I would write:

#macro FormatKeyword(Format)
    #if (Format = "png") png #end
    #if (Format = "jpeg") jpeg #end
    #if (Format = "bmp") bmp #end
#end

-- 
dik
Rendered 1024 of 921600 pixels (0%)


Post a reply to this message

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