(TBarcode2D_QRCode)
Returns the parity value of a barcode text that will be encoded into a series of structured append symbols.
function GetParity(Barcode: string; AllowEscape: Boolean; var InvalidIndex: Integer): Byte; virtual;
The method returns the parity value of a barcode text that will be encoded into a series of structured append symbols. The value will be used in the structured append block, and the structured append block will be used by each symbol in the series of QRCode structured append symbols. See also the "Structured append" section in the "TBarcode2D_QRCode" article.
Barcode: string; It's the original input text before division into the each symbol in the series of structured append symbols.It is of type string.
For Delphi/C++ Builder 2007 or early, the Barcode parameter is in fact an AnsiString. By default, it is an ANSI encoding string, if you want to use other encoding scheme (for example the UTF-8, UTF-16), please convert it in the OnEncode event, or specify the converted string in the Barcode parameter. Also you can use the method to caculate the parity of a block of binary (bytes) data.
For Delphi/C++ Builder 2009 or later, it is in fact a UnicodeString instead of AnsiString. By default, the unicode string will be converted to an ANSI encoding string, then caculate its parity. If you want to use other encoding scheme (for example the UTF-8, UTF-16), please convert it in the OnEncode event, or use the GetParity (Syntax 2) overloading method and specify the converted string in its Data parameter. If you want to caculate the parity of a block of binary (bytes) data, please use the GetParity (Syntax 2) overloading method.
AllowEscape: Boolean; Specifies whether to allow users to insert the escape sequences to the Barcode parameter value, in order to place the function characters and additional control information. See also the "Escape sequences" section in the "TBarcode2D_QRCode" article.
InvalidIndex: Integer; If there is any invalid character in the barcode text that is specified by the Barcode parameter, the parameter returns the position index of first invalid character, the index 1 denotes that the first character is invalid character. Otherwise, it returns the zero.
If the method succeeds, it returns the parity value, it's an 8-bit byte value. And the InvalidIndex parameter returns zero. If the method fails, the InvalidIndex parameter returns a position index of first invalid character, it's an integer value greater than 0.
See also the "Structured append" section in the "TBarcode2D_QRCode" article.