POV-Ray : Newsgroups : povray.general : Macro with variable number of parameters... : Macro with variable number of parameters... Server Time
29 Jul 2024 12:27:18 EDT (-0400)
  Macro with variable number of parameters...  
From: connerc
Date: 18 Jun 1999 14:12:11
Message: <376a8bf8$1$pbaarep$mr2ice@news.povray.org>
Is it possible to create a macro with a variable number of
parameters?


I'm trying to create a macro that counts the number of
parameters passed to it and then issue the #macro definition.

Is this possible?

I want a way to make it so the user doesn't have to provide
information that isn't necessary.  Based on the value of the
first parameter, the second is always needed, but the third
may not be.  I'd like to allow the user to do the following.

myMacro(0,"a")

or

myMacro(1,"a","b")

The first and second parameter are needed, but if the first is a 0
(instead of a 1) the third value isn't necessary.

Anyone have any ideas?

-- 
============================================================
  Suburbia is where the developer bulldozes out the trees,
  then names the streets after them.
  
  -- Bill Vaughn
============================================================
   Friday, June 18, 1999 - 02:06 PM (EDT) 
============================================================

_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~~~~~~~~~~-_
+                                   +            +
+   Chris C. Conner                 +    This    +
+   cco### [at] amerisurecom-NOSPAM    +    space   +
+   con### [at] geocitiescom-NOSPAM    +    for     +
+   con### [at] usanet-NOSPAM          +    rent    +
+                                   +            +
~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-__________-~


Post a reply to this message

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