Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The opposite of ord().

Status
Not open for further replies.

Kudel

Programmer
Dec 3, 2002
36
0
0
NO
Hi

What is the func. that turns 65 into 'A' and 66 into 'B'?

-Kudel
 
Use CHR(nn) to convert to a character - where nn is the decimal value of the ASCII code
If you want a character hard coded with a CONST, use #nn
eg
[tt] CONST
CR = #13;
Exclamation = #33;
[/tt]
Similarly, you can code it into a string:
[tt]
MyString := 'Greetings' + #33;
[/tt]
or
[tt]
MyString := 'Greetings' + chr(33);
[/tt]

BTW, related functions to ORD are SUCC, PRED and INC(ie successor, predecessor and increment). Check out the help by searching for ordinal routines in the index tab

You can often find help for related functions by placing your cursor over the function, press F1, then when the help appears, and choose See Also

Chris ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top