Home > Language Reference > Classes > StreamSerial
Direction Property
Direction of communication.
Syntax
Public Property Get Direction() As HbStream
Public Property Let Direction(ByVal eDirection As HbStream)
| Parameter | Description |
| eDirection | Direction of communication. |
Remarks
This property is only useable on open ports using the IrDA protocol and indicates the direction of the data stream. You can change the communication direction on an open port at any time.
The following example illustrates this by sending a byte to a external device via the IrDA port, then waits for a byte in response.
Private Sub Button1_Click() Dim s as new StreamSerial Dim b as Byte s.Open hbPortIrDA, 32900 On Error Goto ERR s.Direction = hbStreamWrite s.Write CByte(10) ' send a byte s.Direction = hbStreamRead s.Read b ' wait for a byte ERR: s.Close End Sub
If you try to write on a port configured for reception, or read on a port configured for transmission, runtime error occurs.
System requirements
| System | Minimal version | Remarks |
| Palm OS | Palm OS 3.3 | N/A |