Discussion:
ASCII Function
(too old to reply)
CP/M User
2010-10-05 08:00:43 UTC
Permalink
Appologies for the new post, I'm trying to find out if there's an
ASCII function (as my title suggests I'm using the latest Turbo Pascal
for CP/M!). Anyway, what this function specifically does is return
the ASCII number for a Character - so a capital "A" returns 65, "B"
returns 66 and so on. I guess if nothing like that exists I guess it
wouldn't be too difficult writing one, I guess it's a question of
making two arrays - one for the letters and the other with the ASCII
values and write a Function which returns a value to each letter. If
someone has already written something like this though or knows where
I can find a routine, I'd very much appreciate that.
CP/M User
2010-10-05 08:10:49 UTC
Permalink
Appologies for the post - so embarrased to see that a simple ORD gives
me the result! :o Even wrote another program somewhere which tests the
ORD function! :o
Dr J R Stockton
2010-10-06 20:07:24 UTC
Permalink
In comp.lang.pascal.borland message <d38f4a05-426d-4adb-a7bb-7a66e684c35
Post by CP/M User
Appologies for the post - so embarrased to see that a simple ORD gives
me the result! :o Even wrote another program somewhere which tests the
ORD function! :o
ISTM possible that ORD is implemented for you as a true function, in
which case byte('A') should be faster and so better than ORD('A') -
if it works on your system.
--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
<http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
<http://www.merlyn.demon.co.uk/clpb-faq.txt> RAH Prins : c.l.p.b mFAQ;
<ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ.
Loading...