Home AMX Forum NetLinx Studio
Options

Checksum Question - Part 2

Working with this:

define_function integer getChecksum(char cmd[])
{
stack_var integer bTotal
stack_var integer nLength
stack_var integer nCT

nLength = LENGTH_STRING(cmd - 1)
nCT = 1

for(nCT=1;nCT<=8;nCT++)
{
bTotal = bTotal + cmd[nCT]
}
bTotal = bTotal & $FF

return bTotal
}

Getting this:

'String used as a CHAR value in a math operation' in relation to the line that says 'nLength = LENGTH_STRING(cmd - 1)'

I'm stumped. I'm trying to get rid of these warnings so I can learn more about this part of the programming, but I'm at a loss. I just fixed a handful of similar problems and learned a lot in the process, but this one isn't coming to me.

Comments

Sign In or Register to comment.