Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 133
  • Last Modified:

How can i get a char's ascii value

Well, the title says it all, i use chr to do the opposite, but how can i do this?

thanks.
0
pin_plunder
Asked:
pin_plunder
  • 2
1 Solution
 
rwilson032697Commented:
Use Ord(AChar)

Cheers,

Raymond.
0
 
rwilson032697Commented:
As above...
0
 
edeyCommented:
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
 
craig_capelCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now