POV-Ray : Newsgroups : povray.general : Macro problem : Re: Macro problem Server Time
29 Jul 2024 00:30:23 EDT (-0400)
  Re: Macro problem  
From: Warp
Date: 11 Oct 2013 13:23:48
Message: <52583424@news.povray.org>
posfan12 <nomail@nomail> wrote:
> #macro randsign()
>  #if (rand(HPlanet_Seed_Value) > 0.5)
>   1
>  #else
>   -1
>  #end
> #end

It's not a bug, but by design (even though it might not be intuitive.)

You have to assign the value you want to "return" from the macro to a
local variable and then have the name of that variable as the last thing
in the macro.

-- 
                                                          - Warp


Post a reply to this message

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