Click to See Complete Forum and Search --> : Byte & MSComm


Salehd
August 26th, 2001, 04:54 AM
How Can I send a Byte using MSComm from visual Basic? Please provide code.

berta
August 26th, 2001, 07:56 AM
on MSDN I found this:

The Output property can transmit text data or binary data. To send text data using the Output property, you must specify a Variant that contains a string. To send binary data, you must pass a Variant which contains a byte array to the Output property.

Normally, if you are sending an ANSI string to an application, you can send it as text data. If you have data that contains embedded control characters, Null characters, etc., then you will want to pass it as binary data.

I think U can try so:

dim mybyte as byte
mybyte=1

'{...}

myMSCOMM.output = mybyte

else using bytes array

dim mybyte_array(1) as byte
mybyte_array(1)=1

'{...}

myMSCOMM.output = mybyte_array

hi,brt

<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/images/bertaplanet.gif'>
</center>

Salehd
August 27th, 2001, 06:23 AM
Thanks but this didn't work, I had a type mismatch error