Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ASCII command in Delphi

221 views
Skip to first unread message

sam

unread,
Apr 22, 2003, 3:34:23 AM4/22/03
to

Hi,
Is there any ASCII command in Delphi? such as ASC in Visual Basic. I want to convert a character into number and then convert from number to character again. In Delphi how to do it?
Thanks for helping me.
sam

Florian Haag

unread,
Apr 22, 2003, 4:12:02 AM4/22/03
to
sam <samue...@hotmail.com> schrieb in im Newsbeitrag:
3ea4f07f$1...@newsgroups.borland.com...

>
> Hi,
> Is there any ASCII command in Delphi? such as ASC in Visual Basic.
> I want to convert a character into number and then convert from
> number to character again. In Delphi how to do it?

Hi,
see help on Chr as well as Ord functions.

HTH
(
--
Florian Haag
ICQ: 114504497
http://fhaag.de.vu/
Free vocabulary training software: http://VocDB.de.vu/


sam

unread,
Apr 22, 2003, 5:23:46 AM4/22/03
to

Hi,
What is the command in Delphi that can convert a string into
CHAR? for example, ORD(InputString), I would like to change
the InputString(is a string type) to ORD Compatible types.

Thanks.

sam

Rene Tschaggelar

unread,
Apr 22, 2003, 8:35:03 AM4/22/03
to
A string is an array of characters already.
So
var mychar:char;
mystring:string;
mybyte:byte;

mystring:='hello world';
mychar:=mystring[5];
mybyte:=ord(mystring[5]);

mychar is now 'o'.
mybyte is the byte of it.

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com
& commercial newsgroups - http://www.talkto.net

0 new messages