[DUG] Ord value of String character

Laurence Bevan laurence at master.co.nz
Thu Oct 26 13:12:26 NZDT 2006


Good point Dave, thanks. 

Laurence


-----Original Message-----
From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz] On
Behalf Of Dave O'Brien
Sent: Thursday, 26 October 2006 12:43 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: RE: [DUG] Ord value of String character

This should work, assuming the string has some content. Are you checking the
length of the string before trying this?

-----Original Message-----
From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz]
On Behalf Of Laurence Bevan
Sent: Thursday, 26 October 2006 9:31 a.m.
To: delphi at ns3.123.co.nz
Subject: [DUG] Ord value of String character

This is probably simple but I can't get my head around it this morning.
I have a string variable of
which I want to obtain the ASCII value of the first character in the string.


I've tried Ord(String[1]) but keep getting an error. Do I need to cast the
first character to a Byte type or something?

Cheers,
Laurence


_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz
http://ns3.123.co.nz/mailman/listinfo/delphi





More information about the Delphi mailing list