Is lookup function searches for keys which are strings? say
<b> lookup("foo",myArray)? </b>
I get undef back. Is this a bug?
what's the good Strings functions library for OpenScad?
lookup( ) doesn't explicitly say so, but since it interpolates it
can't work on anything but numbers.
You want search( ).
If you're searching for a string, the first argument needs to
be an array containing as its only element that string.
For the default num_returns_to_match of 1, the not-found
results are a little peculiar. Found yields an array that
contains as its only element the index of the entry; not-found
yields an array that contains as its only element an empty
wait whaaaat?? I'm using search("top", … searching for "top" why it
returns me "type"? who wrote this rap?
See the documentation and my note about how if you're searching for
a string you need to make it be an array containing only that
string. When you just say "top" it's interpreted as "search for t,
o, or p".