POV-Ray : Newsgroups : povray.text.scene-files : Character number lookup dict - chr.inc : Re: Character number lookup dict - chr.inc Server Time
25 Apr 2024 18:02:44 EDT (-0400)
  Re: Character number lookup dict - chr.inc  
From: Tor Olav Kristensen
Date: 6 Jun 2023 12:45:00
Message: <web.647f61fb1f4d89424a345f4489db30a9@news.povray.org>
"ingo" <nomail@nomail> wrote:
> A scene file I just added to my tool box directory.
>
> As the #switch #case only compares floats and not strings I always have to
> figure out what character is what number. To scratch that itch a little scene
> that writes an include file for the 'reverse look up' of the chr function using
> a dictionary. It covers the ascii chars 34 to 127 as I don't know how to use a
> 'bell' as key.

Can you not use asc() for this ?`

http://www.povray.org/documentation/view/3.7.1/228/

You can use chr(7) to quote the ASCII bell character.

https://www.povray.org/documentation/view/3.7.2/232/

This code outputs 7

#version 3.7;
global_settings { assumed_gamma 1.0 }
#debug "\n"
#debug str(asc(chr(7)), 0, 0)
#debug "\n"
#error ""

Perhaps chr(7) can also be used as a key in a v3.8 dictionary (?)

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message

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