Solved

Sending bytes using the serial com-port

Posted on 1997-07-03
3
237 Views
Last Modified: 2010-04-03
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.
0
Comment
Question by:Lillan061397
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Accepted Solution

by:
GGR earned 50 total points
ID: 1338128
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
 

Author Comment

by:Lillan061397
ID: 1338129
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
 

Author Comment

by:Lillan061397
ID: 1338130
It works!!! Thanks! The ASCII tabel I first had was wrong, so I thought that it didn't work.

Linda.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi inherited method 6 89
Need Help Delphi 2010 CheckBox1 Stored value in memo 13 102
enhance the following code 3 54
Firemonkey how to swip panel with finger tap 1 42
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question