|
|
hi,
ingo <ing### [at] tagpovrayorg> wrote:
> Don't know the proper word for what I do, but the code below fails. Should
> it? Can it be made not to fail?
> #declare T = dictionary {
> ["Index"] : array[2]{"Base1", "Base2"},
> ["Base1"] : <1,2,3>,
> ["Base2"] : <0,1,2>
> };
> #declare Chain = T["Index"][0];
> #declare Vec = T.Chain;
> Parse Error: Cannot pass uninitialized identifier to non-optional LValue.
heh, turns out there is a way (thanks to the Kenneth + clipka exchange :-))
#version 3.8;
global_settings {assumed_gamma 1}
#include "strings.inc"
#declare T = dictionary {
["Index"] : array[2]{"Base1", "Base2"},
["Base1"] : <1,2,3>,
["Base2"] : <0,1,2>
};
#declare Chain = T["Index"][1];
#declare Vec = Parse_String(concat("T.",Chain));
#debug concat("Vec: <",vstr(3,Vec,",",0,0),">\n")
:-)
regards, jr.
Post a reply to this message
|
|