POV-Ray : Newsgroups : povray.beta-test : Optional macro parameters : Re: Optional macro parameters Server Time
25 Apr 2024 10:49:26 EDT (-0400)
  Re: Optional macro parameters  
From: Mike Horvath
Date: 23 Mar 2017 16:08:45
Message: <58d42b4d$1@news.povray.org>
On 3/23/2017 3:10 PM, clipka wrote:
> 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,)
>

That is some weird syntax.


Mike


Post a reply to this message

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