Parity Property
Sets and returns the parity communications parameter.
Syntax
Visual Basic
object.Parity [ = value ]
Visual C++
object.GetParity()
object.SetParity(value)
Delphi
object.Parity [ := value ]
| Part
| Description |
| object |
An object expression that evaluates to a PortController object. |
| value |
An integer representing the parity type.
|
Example
Visual Basic
'Set parity
myPortController.Parity = 0
'Get parity
Dim parity As Integer
parity = myPortController.Parity
Visual C++
// Set parity
m_myPortController.SetParity(NOPARITY);
// Get parity
int parity = m_myPortController.GetParity();
Delphi
// Set parity
myPortController.Parity := 0;
// Get parity
var parity: Integer; // declare variable in the proper place
parity = myPortController.Parity;
Remarks
Valid parity values are as follows:
| Setting
| Windows.h Constant (VC++)
| Description |
| 0 |
NOPARITY |
None (Default) |
| 1 |
ODDPARITY |
Odd |
| 2 |
EVENPARITY |
Even |
| 3 |
MARKPARITY |
Mark |
| 4 |
SPACEPARITY |
Space |
Default
0
Returns
An integer representing the parity of the port.
Errors
Attempting to set Parity to an invalid value
will cause the PortController to throw an "Invalid argument" exception.
See Also
DataBits, BaudRate, StopBits, Open()
|