POV-Ray : Newsgroups : povray.newusers : Use of macros returning values : Re: Use of macros returning values Server Time
29 Jul 2024 14:17:11 EDT (-0400)
  Re: Use of macros returning values  
From: Mike Williams
Date: 7 Sep 2005 12:00:21
Message: <437diPAM6wHDFwLB@econym.demon.co.uk>
Wasn't it Steve who wrote:
>I'm attempting to write a macro that looks up a value in a table

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


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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