POV-Ray : Newsgroups : povray.beta-test : Optional macro parameters : Re: Optional macro parameters Server Time
25 Apr 2024 06:35:53 EDT (-0400)
  Re: Optional macro parameters  
From: clipka
Date: 23 Mar 2017 15:10:21
Message: <58d41d9d$1@news.povray.org>
Am 23.03.2017 um 17:03 schrieb Bald Eagle:
> I tried to write a macro using optional parameters.
> 
> POV-Ray gave me back errors, saying it wanted n parameters, but I only supplied
> x.
> 
> The number of parameters I specified was n, ranging from 0 to 4.
> I tried supplying 0-3, but it seemed to want all 4.

You can omit the optional parameters, but you still have to specify the
commas. For example:

    #macro Foo(A, optional B, C)
      ...
    #end

    Foo(1,,3)

Currently, this is true even if the optional parameters are at the end
of the parameter list:

    #macro Foo(A, B, optional C)
      ...
    #end

    Foo(1,2,)


Post a reply to this message

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