OutputEx
Outputs/Sends data (Places bytes into the transmit buffer)
Not available at design time.
Only available with Comm32. Not available with MSComm32 (See remarks below)
 |
| |
Syntax |
result = object.OutputEx(value) |
| |
|
|
| |
object |
Name of the communications control. |
| |
value |
A String or byte array containing the characters/bytes to place into the transmit buffer. |
| |
result |
Number of characters that were successfully placed into the transmit buffer. |
| |
|
|
| |
Example. |
|
| |
|
n = object.OutputEx(Text1.Text) |
'// Places the contents of a text box
'// into the transmit buffer.
'// n contains the number of characters
'// that were successfully placed into the
'// transmit buffer |
| |
|
|
'// SEE REMARKS BELOW |
|
 |
Remarks:
If you've used MSComm32 before then you will have used the .Output property. It is the only way that MSComm can transmit data.
One problem with the standard Output property is that it doesn't give any indication of the success or failure of the operation. For reasons of backward compatibility our Comm32 ocx supports the same 'simple' .Output property but we've added a new output function with EXtended capabilities. OutputEx
The standard .Output property supported by both MSComm32 and our Comm32 does not return any result indicating whether the data was transmitted. This new function .OutputEx returns the number of characters that were successfully placed into the transmit buffer.
OutputEx isn't a property. It's a Function. The syntax can therefore not be the same as the Output property.
The standard Output property is used like this:-
Comm.Output = someString
The OutputEx function is used like this:-
n = Comm.OutputEx( someString )
The return value n is the number of characters that were successfully shifted into the transmit buffer. This may be fewer than you originally tried to send - or even zero - for example if the transmit buffer was full. You can now use n to rearrange the string and output any remaining characters again.
The behavior of this function is also affected by the .ParallelEnable and .TxTimeout properties.
|