POV-Ray : Newsgroups : povray.newusers : Something strange is happening to me (again) : Re: Something strange is happening to me (again) Server Time
20 Oct 2025 16:47:32 EDT (-0400)
  Re: Something strange is happening to me (again)  
From: kurtz le pirate
Date: 20 Oct 2025 09:42:40
Message: <68f63c50$1@news.povray.org>
On 20/10/2025 13:20, Alain Martel wrote:
> Le 2025-10-20 à 03:53, kurtz le pirate a écrit :
>>
>>
>> Hello,
>>
>> Let an array of "4D" vectors.
>> This code works well :
>>
>> #write ( FH, 
>> Array[i].x,",",Array[i].y,",",Array[i].z,",",Array[i].filter )
>>
>>
>>
>>
>> Now with and array of "5D" vectors.
>> Base on the same schema i code this :
>>
>> #write ( FH, 
>> Array[i].x,",",Array[i].y,",",Array[i].z,",",Array[i].filter,",",Array[i].transmit
)
>>
>> And i get this error : "Expected 'string', colour identifier found 
>> instead".
>>
>>
>> On <https://wiki.povray.org/content/Reference_Talk:Vector_Expressions> 
>> from Bald Eagle, you can read :
>> #declare Vector = < 1, 2, 3, 4, 5>;
>> ...
>> #declare Fifth_Component = Vector.transmit;// 5
>>
>>
>> The fifth element corresponds well to the keyword "transmit".
>> So why did this error occur?
>>
>> I got around the issue like this :
>> #declare _x = Array[i].x;
>> #declare _y = Array[i].y;
>> #declare _z = Array[i].z;
>> #declare _f = Array[i].filter;
>> #declare _t = Array[i].transmit;
>> #write ( FH, _x,",",_y,",",_z,",",_f,",",_t )
>>
>> However, I would like to understand what is wrong with my syntax.
>> Thank you for your help.
>>
> 
> Working from William's reply, I have this workaround :
> Replace :
> #write 
> (
FH,Array[i].x,",",Array[i].y,",",Array[i].z,",",Array[i].filter,",",Array[i].transmit
)
> 
> With :
> #declare Trans = Array[i].transmit;
> #write ( FH, 
> Array[i].x,",",Array[i].y,",",Array[i].z,",",Array[i].filter,",",Trans )
> 

Yes Alain, shorter as my workaround but in the same spirit.




-- 
kurtz le pirate
compagnie de la banquise


Post a reply to this message

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