Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?

CHECKSUM

Description 

The CHECKSUM function returns a simple numeric checksum of a character string. It takes the general form: 

CHECKSUM(expression)

Where:

expression may evaluate to any result but will usually be a string. 

The function scans every character in the expression and returns a numeric addition of the characters within the the expression. This is done by calculating the checksum by summing the product of the ASCII value of each character and its position within the string.

An example of use is as: 

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


Go back to jBASE BASIC.

Was this article helpful?