Introduction MTB Statements File System Compiler Applications Reference Guide Index

Language Structure Data Division I/O Format Division Procedure Division Mnemonics

CHKSUM function

Syntax: CHKSUM(string-argument)
Discussion: The CHKSUM function returns the block check character (BCC) for the specified string-argument.

The string-argument may be a string constant, a single-element string variable, a string array element, a string expression, or a string function. It may be from 1 to 254 characters long.

Note: The CHKSUM function uses the same check sum algorithm that is used by Comet's terminal protocol.

Example:
LENGTH 1 & LOCAL VALUE$
.
VALUE$ = CHKSUM(DATA$)
In the above example, the CHKSUM function will return the block check character for the data value stored in the string variable DATA$. This block check character will be stored in the string variable VALUE$.