POV-Ray : Newsgroups : povray.documentation.inbuilt : [3.8] macro optional example : [3.8] macro optional example Server Time
29 Jan 2023 21:29:29 EST (-0500)
  [3.8] macro optional example  
From: ingo
Date: 7 Dec 2018 13:20:41
Message: <XnsA9B1C4C8DAA2Fseed7@news.povray.org>
http://wiki.povray.org/content/Reference:User_Defined_Macros#The_macro_Dir
ective#Optional_Parameters

The example for the optional option for macros has a bit too many ";" 't 
won't run like that.

cleaned up:

#macro Foo(P1, optional P2)
#ifndef(local.P2) #local P2 = 0; #end // provide default for P2
...
#end

#declare X=1;
#declare Y=2;
Foo(X,Y)
#undef Y
Foo(X,Y)
Foo(X,)

ingo


Post a reply to this message

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