checksum16, checksum16file

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

checksum16 <intvar> <string>
checksum16file <intvar> <filename>

Remarks

This macro function calculates the checksum(16bit) 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 checksum16file, the system variable "result" is set to -1.

Example

str = 'this is a test string to be checksum16ed'
checksum16 crc str

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

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