POV-Ray : Newsgroups : povray.advanced-users : variables in sdl : Re: variables in sdl Server Time
5 Jul 2024 15:09:51 EDT (-0400)
  Re: variables in sdl  
From: Mike Williams
Date: 23 Jan 2008 05:21:08
Message: <qiVxa1BEUxlHFwZw@econym.demon.co.uk>
In most languages there'd be an eval() statement.

In POV SDL there's a nasty Parse_String() macro in strings.inc

#include "strings.inc"

#declare var0 = "foo";
#declare var1 = "bar";
#declare var2 = "baz";

#declare J=0;
#while (J<3)
   #declare A = concat("var",str(J,1,0));
   #debug concat(Parse_String(A),"\n")
   #declare J=J+1;
#end


It is much nicer, and more efficient, to create var as an array and use 
var[J].

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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