POV-Ray : Newsgroups : povray.newusers : functions and macros : Re: functions and macros Server Time
18 May 2024 02:55:32 EDT (-0400)
  Re: functions and macros  
From: Leroy
Date: 18 Jun 2023 13:10:00
Message: <web.648f397f1d2497943807ba4ef712fc00@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:
> 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

short answer: NO
Long answer: If you can turn that macro into a function then you can call that
function.


Post a reply to this message

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