Sending bytes using the serial com-port

Hi!
I need help whith sending bytes to the serial com-port. Sending Char is no problem, but I want to send Byte. Whith Byte I meen that I want to be able to send 123 in one byte and not in three. How do I do that? I'm using Delphi 2 and overlapped structure on the port, if need to know that.
Lillan061397Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
GGRConnect With a Mentor Commented:
I'm not sure this is what your wanting, but try this:

aByte := StrToIntDef('123', 0);
{.. Send the Byte ..}

Where aByte = aByte:Byte;
and '123' is the string you want converted to a byte.

I have only tested this in Delphi 3.0 I'm not at my D2 Machine.
0
 
Lillan061397Author Commented:
I want aByte to have the value 123. 123 is an integer and not a string. It's very important that the value is correct.

Thanks!
0
 
Lillan061397Author Commented:
It works!!! Thanks! The ASCII tabel I first had was wrong, so I thought that it didn't work.

Linda.
0
All Courses

From novice to tech pro — start learning today.