Sets and returns the character that replaces an invalid character in the data stream when a parity error occurs.
Syntax
object.ParityReplace [ = value ]
The ParityReplace property syntax has these parts:
Part | Description |
object | An object expression that evaluates to an object in the Applies To list. |
value | A string expression representing a character, as described in Remarks. |
Remarks
The parity bit refers to a bit that is transmitted along with a specified number of data bits to provide a small amount of error checking. When you use a parity bit, the MSComm control adds up all the bits that are set (having a value of 1) in the data and tests the sum as being odd or even (according to the parity setting used when the port was opened).
By default, the control uses a question mark (?) character for replacing invalid characters. Setting ParityReplace to an empty string ("") disables replacement of the character where the parity error occurs. The OnComm event is still fired and the CommEvent property is set to comEventRXParity.
The ParityReplace character is used in a byte-oriented operation, and must be a single-byte character. You can specify any ANSI character code with a value from 0 to 255.
Data Type
String