Weird Program Behaviour
Is there some actual difference between these two chunks of code or is this just some weird behavior from the compilier?
When the string "'GrpmD01*-00180',$0D,$0A" is fed into the two blocks below it produces different results. Version 2 produces the expected result of -18, while version 1 produces a result of -26000something.
Version 1:
Version 2:
When the string "'GrpmD01*-00180',$0D,$0A" is fed into the two blocks below it produces different results. Version 2 produces the expected result of -18, while version 1 produces a result of -26000something.
Version 1:
active(find_string(sTemp,'GrpmD01',1)): //volume changes
{
stack_var char t1[50]
t1 = sTemp
remove_string(t1,'*',1)
nLevels = atoi(t1)/10
}
Version 2:
active(find_string(sTemp,'GrpmD01',1)): //volume changes
{
stack_var char t1[50]
stack_var sinteger t2
t1 = sTemp
remove_string(t1,'*',1)
t2 = atoi(t1)
nLevels = t2/10
}
0
Comments
One reliable workaround:
Another is to split the operation over two lines, as you found. You can also do: