POV-Ray : Newsgroups : povray.beta-test : Looping Dictionaries : Looping Dictionaries Server Time
17 Apr 2024 20:56:49 EDT (-0400)
  Looping Dictionaries  
From: ingo
Date: 1 Dec 2018 14:45:14
Message: <XnsA9ABD31EF6948seed7@news.povray.org>
As the dictionary implementation seems to be based upon, or closely 
related to arrays, I tried to loop over a dict as if it where a Array. 
This doesnt work and yes, the docs are silent on this.

Is it possible?
Can it be made possible? (Are dicts kept in order?)

get the length / dimension_size and loop over a dict getting a key value 
pair as pseudo tuple as result.

#while (i < dimension_size(dict,1)-1)
    	#local (key, value) = dict[i];
#end

It would be useful when working with splines or boning and inverse 
kinematics to have both ways of accessing a dict. Another one would be 
appending dictionaries without knowing all the exact keys.

ingo


Post a reply to this message

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