406
CRC( ) Function
Cyclic-Redundancy-Check
Format
CRC(chars$[,basis$][,ERR=stmtref])
Where:
basis$
Optional initial value to be used as the basis of the CRC. It must be two
characters long if included in the statement. Default: $0000$.
chars$
String of characters on which to calculate a cyclic redundancy check.
stmtref
Program line number or label to transfer control to.
Note: The CRC( ) function is used primarily for generating transmission checksums
on synchronous communications.
Returns
Cyclic redundancy checksum (in internal format).
Description
The CRC( ) function returns the cyclic redundancy checksum of a string of
characters.
Use the initial value (basis$) to generate an overall CRC( ) of multiple strings. See the
example below, where CRC(B$) with an initial value of CRC(A$) will be the same
as CRC(A$+B$). If you omit the initial value, ProvideX uses the default value,
$0000$.
Examples
A$="Hello",B$="World"
0010 LET C$=CRC(A$)
0020 LET C$=CRC(B$,C$)
Yields the same result as:
0030 LET C$=CRC(A$+B$)
That is:
Value
HTA(C$)
After line 0010
$F353$
After line 0020
$6053$
After line 0030
$6053$