PortName Property
Returns the name of the port ("COM1", "COM2", etc.).
Syntax
Visual Basic
object.PortName
Visual C++
object.GetPortName()
Delphi
object.PortName
| Part
| Description |
| object |
An object expression that evaluates to a PortController object. |
Example
Visual Basic
'Get port name
Dim portName As String
portName = myPortController.PortName
Visual C++
// Get port name
CString strPortName = m_myPortController.GetPortName();
Delphi
// Get port name
var portName: String; // declare variable in the proper place
portName := myPortController.PortName;
Remarks
None
Returns
A string containing the name of the open port.
Errors
Reading the PortName property while the port is closed is not permitted
and will cause the PortController to throw a "Port is closed" exception.
See Also
Open(), PortHandle
|