[OpenSCAD] How to detect chr(0)

Fantome paul at brownsbrain.com
Fri Apr 17 17:37:28 EDT 2015

doug.moen wrote
> The reason you see ASCII values is that ASCII is a proper subset of
> unicode. The letter 'A' has value 65 in ASCII and also value 65 as a
> Unicode code point. But OpenSCAD is still a Unicode system, not an ASCII
> system, because the entire Unicode range is supported. So there's no need
> to stop at chr(255), when you also have chr(256), chr(257), and so on.
> If you want to represent an array of values between 0 and 255 using a
> string, you can still do that, you'll just have represent 0 in a different
> way: pick a different code point. Or you could add an offset, and use the
> range chr(1) to chr(256) to represent the values 0 to 255. Of course, I'm
> not really sure what you're trying to do, but I hope this has helped.

Hey thanks! Sometimes the simple answers are the best. Since OpenSCAD is
using Unicode then yes, I can simply use chr(256) to represent a zero. I
like it. 

Thanks again. Satisfaction has just increased to 100%.

View this message in context: http://forum.openscad.org/How-to-detect-chr-0-tp12351p12409.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

More information about the Discuss mailing list