discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Reverse chr()?

R
runsun
Sun, May 24, 2015 12:55 AM

There's a not-yet documented function chr(97) => "a". Is there a reversed
function of it, like ichr("a")=>97 ?


$  Runsun Pan, PhD

$ -- OpenScad_DocTest: doc and unit test ( Github , Thingiverse  )

$ -- hash parameter model: here , here

$ -- Linux Mint 17.1 Rebecca x64  + OpenSCAD 2015.03.15/2015.04.01.nightly

--
View this message in context: http://forum.openscad.org/Reverse-chr-tp12735.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

There's a not-yet documented function chr(97) => "a". Is there a reversed function of it, like ichr("a")=>97 ? ----- $ Runsun Pan, PhD $ -- OpenScad_DocTest: doc and unit test ( Github , Thingiverse ) $ -- hash parameter model: here , here $ -- Linux Mint 17.1 Rebecca x64 + OpenSCAD 2015.03.15/2015.04.01.nightly -- View this message in context: http://forum.openscad.org/Reverse-chr-tp12735.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Sun, May 24, 2015 1:13 AM

No.

But  nophead
http://forum.openscad.org/How-to-detect-chr-0-tp12351p12418.html  wrote
one:

function asc(c, n = 0) = c == chr(n) ? n : asc(c, n + 1);

Remember this is unicode not ASCII. Check what happens > 7F.

Also chr() IS  documented
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/String_Functions#chr  .


Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/

View this message in context: http://forum.openscad.org/Reverse-chr-tp12735p12736.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

No. But nophead <http://forum.openscad.org/How-to-detect-chr-0-tp12351p12418.html> wrote one: function asc(c, n = 0) = c == chr(n) ? n : asc(c, n + 1); Remember this is unicode not ASCII. Check what happens > 7F. Also chr() IS documented <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/String_Functions#chr> . ----- Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ -- View this message in context: http://forum.openscad.org/Reverse-chr-tp12735p12736.html Sent from the OpenSCAD mailing list archive at Nabble.com.
R
runsun
Sun, May 24, 2015 1:41 AM

Got it. Thx


$  Runsun Pan, PhD

$ -- OpenScad_DocTest: doc and unit test ( Github , Thingiverse  )

$ -- hash parameter model: here , here

$ -- Linux Mint 17.1 Rebecca x64  + OpenSCAD 2015.03.15/2015.04.01.nightly

--
View this message in context: http://forum.openscad.org/Reverse-chr-tp12735p12738.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Got it. Thx ----- $ Runsun Pan, PhD $ -- OpenScad_DocTest: doc and unit test ( Github , Thingiverse ) $ -- hash parameter model: here , here $ -- Linux Mint 17.1 Rebecca x64 + OpenSCAD 2015.03.15/2015.04.01.nightly -- View this message in context: http://forum.openscad.org/Reverse-chr-tp12735p12738.html Sent from the OpenSCAD mailing list archive at Nabble.com.