[OpenSCAD] Length of vector members

L Boyd lboyd at frontiernet.net
Thu Sep 24 10:29:04 EDT 2015


When using len() for the length of vector members, a single numeric value
returns undef rather than 1.

Examples:
 
 a = [[1,2],3,"string"];
 
 echoing the string part and lengths 
 
 ECHO: "a   = ", [[1, 2], 3, "string"], " length = ", 3
 ECHO: "a[0] = ", [1, 2], " length = ", 2
 
 so far so good, but
 
 ECHO: "a[1]   = ", 3, " length = ", undef
 ECHO: "a[0][1] = ", 2, " length = ", undef
 
 no, it is not related to having a mixed vector
 
 b=[5,4,3,1];

 ECHO: "b   = ", [5, 4, 3, 1], " length = ", 4
 ECHO: "b[0] = ", 5, " length = ", undef

 for the string everything behaves great
 
 ECHO: "a[2]   = ", "string", " length = ", 6
 ECHO: "a[2][1]   = ", "t", " length = ", 1




--
View this message in context: http://forum.openscad.org/Length-of-vector-members-tp13971.html
Sent from the OpenSCAD mailing list archive at Nabble.com.




More information about the Discuss mailing list