Solved

How can i get a char's ascii value

Posted on 2000-02-16
4
117 Views
Last Modified: 2010-04-04
Well, the title says it all, i use chr to do the opposite, but how can i do this?

thanks.
0
Comment
Question by:pin_plunder
  • 2
4 Comments
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2529564
Use Ord(AChar)

Cheers,

Raymond.
0
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 0 total points
ID: 2529565
As above...
0
 
LVL 6

Expert Comment

by:edey
ID: 2529688
just a note: ord will also give you the "ordinal" value of any enumerated type.  This function is/can be very important.

GL
Mike
0
 
LVL 2

Expert Comment

by:craig_capel
ID: 2530933
Ok and heres some sample code..... As Rwilson rightly puts it you use ord

var
 c: char;
begin
   c:='a';
   messagedlg('The Ascii Value of this char is: '+inttostr(ord(c)),mtconfirmation,[mbyes,mbno],0);
end;
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question