Sets and returns the character that replaces an invalid character in the data stream when a parity error occurs.
object.ParityReplace [ = value ]
The parts of the ParityReplace property syntax are described in the following table.
Part | Description |
---|---|
object | An object expression that evaluates to an object. |
value | A string expression representing a character, as described in 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 Comm 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 1009.
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.
String