checksum8, checksum8file

Calculates the 8bit-checksum of a string or a file.

checksum8 <intvar> <string>
checksum8file <intvar> <filename>

Remarks

This macro function calculates the checksum(8bit) of a string or a file.

The calculated value stores the variable "intvar" as mathematical value.
If the <filename> file can not open by using checksum8file, the system variable "result" is set to -1.

Example

str = 'this is a test string to be checksum8ed'
checksum8 crc str

; Display checksum8 result asHEX
sprintf '0x%08X' crc
messagebox inputstr 'checksum8 = '

checksum8file crc 'foo.bin'
if result = -1 then
    messagebox 'file open error' 'checksum8 = '
else
    sprintf '0x%08X' crc
    messagebox inputstr 'checksum8 = '
endif