POV-Ray : Newsgroups : povray.newusers : functions and macros : functions and macros Server Time
18 May 2024 04:15:16 EDT (-0400)
  functions and macros  
From: kurtz le pirate
Date: 18 Jun 2023 10:58:34
Message: <648f1b9a$1@news.povray.org>
Hello,


Can a function call a macro ?

I have defined this function :

114:#declare dayfrac_to_local_hr = function (df, tz) {
115:  24.0*limit_zero2one(df + (tz/24.0))
116:  }

and i get this error :
line 115
Parse Error: Cannot pass uninitialized identifier as non-optional macro
parameter.



Of course the macro is defined before

73:#macro limit_zero2one(_value)
74:  #local limited = _value - floor(_value);
75:  #if (limited < 0)
76:    #local limited = limited + 1.0;
77:  #end
78:  limited
79: #end



Hence the question : Can a function call a macro ?



-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

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