CHECKSUM


The CHECKSUM function returns a simple numeric checksum of a character string.

 

COMMAND SYNTAX

CHECKSUM(expression)

 

SYNTAX ELEMENTS

The expression may evaluate to any result but will usually be a string. The function then scans every character in the string and returns a numeric addition of the characters within the string.

 

NOTES

The function calculates the checksum by summing the product of the ASCII value of each character and its position within the string.

 

EXAMPLES

INPUT DataBlock,128:
IF CHECKSUM(DataBlock) = ExpectedChk THEN
    CRT AckChar:
END ELSE
......


jBC