Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Convert character to ascii value

1 view
Skip to first unread message

bernieo

unread,
Jul 21, 1999, 3:00:00 AM7/21/99
to
I don't have my manual in front of me... but,

with something like the following I can convert an octal value to its
ascii character equivalent:

set character [format "%c" 0x41]

character now = 'A'

How can I do the reverse.

I want to find out the numeric ascii value for the letter 'A'.

????

Help.


Roger E Critchlow Jr

unread,
Jul 21, 1999, 3:00:00 AM7/21/99
to
bernieo <ber...@home.com> writes:

% scan A %c value
1
% format 0x%02x $value
0x41

-- rec --


Cameron Laird

unread,
Jul 22, 1999, 3:00:00 AM7/22/99
to

In article <37964745...@home.com>, bernieo <ber...@home.com> wrote:
>I don't have my manual in front of me... but,
But you do have a Web browser available, no? So
you could search DejaNews to find <URL:http://
x44.deja.com/getdoc.xp?AN=501251213> or <URL:
http://x44.deja.com/getdoc.xp?AN=398595340> or
...

>
>with something like the following I can convert an octal value to its
>ascii character equivalent:
>
>set character [format "%c" 0x41]
That's hexadecimal, not octal.

>
>character now = 'A'
>
>How can I do the reverse.
>
>I want to find out the numeric ascii value for the letter 'A'.
.
.
.
scan A %c code
set numeric_ascii_value [format 0x%x $code]
--

Cameron Laird http://starbase.neosoft.com/~claird/home.html
cla...@NeoSoft.com +1 281 996 8546 FAX

0 new messages