POV-Ray : Newsgroups : povray.general : Macro Initialization? : Re: Macro Initialization? Server Time
10 Aug 2024 07:18:43 EDT (-0400)
  Re: Macro Initialization?  
From: Alex Wolff
Date: 10 Feb 2000 13:26:28
Message: <38A302F5.8EF2B964@gmx.de>
Bill DeWitt wrote:

> I want to call the macro with only those values that are relevant to
> it's
> present use.

just like philippe still mentioned:use the ifndef-function. i think it
could be done without an *.inc-file like this:

// here you can declare only the params you need:
#declare par1=35;
#declare par2=3.7;
#declare par3=383;
// before calling the macro, all undefined params are checked and
// set to a default value:
#ifndef (par1) #declare par1=1.0; #end
#ifndef (par2) #declare par1=0.0; #end
#ifndef (par3) #declare par1=2.5; #end
.
.
// now, with all params declared, you can call your macro:
gadget (par1,par2,par3,...)

alex


Post a reply to this message

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