POV-Ray : Newsgroups : povray.newusers : Use of macros returning values : Re: Use of macros returning values Server Time
29 Jul 2024 14:14:44 EDT (-0400)
  Re: Use of macros returning values  
From: Florian Brucker
Date: 7 Sep 2005 13:09:56
Message: <431f1ee4$1@news.povray.org>
> Why not just add the ";"s that it's asking for. This works:
> 
> #macro __get_table_element1( tbl, e, n )
> 
>  // Macro to calculate interpolated value from table.
> 
>  #local tick = clock * 1399;
>  #local ftick = floor( tick );
>  #local i0 = ( ftick * n ) + e;
>  #local i1 = i0 + n;
> 
>  #if ( 1399 - ftick )
> 
>   ( tbl[i1] );
> 
>  #else
> 
>   ( tbl[i0] );
> 
>  #end
> 
> #end

Adding the ";" to the end of the declaration, as in

  #local q10 = __get_table_element1( clip_array, 0, 6 );

would be even better, because it does not break things like

  #local q10 = __get_table_element1( clip_array, 0, 6 )*100;


HTH,
Florian


Post a reply to this message

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