Marconi September 11, 2002
How Can I get the ASC code from any CHAR. Thanks any help. The Delphi function is: ORD. For example, Ord('A') returns 65 Re: Re: Brett Kingston What data type is required for this? Re: Re: Re: webmaster Guido Ord(C) needs a parameter C of type "char" (character). So, this will work: var AsciiVal: integer; C: Char; S: string; begin C := 'B'; AsciiVal := Ord(C); // gives ASCII-code of 'B' AsciiVal := Ord(Edit1.Text[1]); // ASCII first character of text in Edit1 S := 'Test'; AsciiVal := Ord(S[2]); // ASCII-code of 'e' But the following will not work: AsciiVal := Ord(Edit1.Text); // error because Edit1.Text is type "string" |
|