Re: Delphi: ASCII Codes
Forum ] [ Delphi Tutorials -- by DelphiLand ]
Posted by Brett Kingston on June 09, 2003 at 15:14:20:
In Reply to: Re: ASCII Codes posted by webmaster Guido on September 11, 2002 at 18:58:21:
: : How Can I get the ASC code from any CHAR.
: : Using CHR(65) the result is 'A'.
: : In Clipper the function ASC do that ASC('A') result 65. But, in Delphi (or Pascal) I don't know how.
: : Thanks any help
: The Delphi function is ORD.
: For example, Ord('A') returns 65
What data type is required for this?
I have this working if I use a static value in the code (i.e. s := IntToStr(Ord('#'));), but if I want # to be replaced by the value of an input box, I keep getting errors. I have tried converting the input to a string, real, integer, but I have had no luck. Can someone help me with an example piece of code?
Related Articles and Replies:
[ DelphiLand: free Delphi source code, tips, tutorials ]