|
|
in news:5c0750c1$1@news.povray.org clipka wrote:
> Am 04.12.2018 um 16:59 schrieb ingo:
>> 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.
>
> `T.Chain` is shorthand for `T["Chain"]`. You don't have a key "Chain"
> in your dictionary.
>
> What you want is
>
> #declare Vec = T[Chain];
>
> Notice the use of square brackets without quotes. This tells POV-Ray
> that the key to use is the content of the variable `Chain`.
Ah, the result of T["Index"][0] is a string, so why quote it again.
Being a bit blind sometimes.
Thanks,
ingo
Post a reply to this message
|
|