Are you sure you can see how it works?
IF ("C" = buf(9)) and ("9" = buf(8))THEN loc1
Looks like
IF ("C" = buf(9)) THEN
IF ("9" = buf(8)) THEN
loc1
ENDIF
ENDIF
which is the positive and obvious way of looking at it but there is another way.
IF ("C" != buf(9)) THEN nextTag
IF ("9" != buf(8)) THEN nextTag
loc1
nextTag:
Call this the negative vision. This is looking for a failure and is more efficient because if the first character fails then no others are tested.
But it works more like this
compFlag var bit
compFlag=1
IF ("C" != buf(9)) THEN compFlag=0
IF ("9" != buf(8)) THEN compFlag=0
IF compFlag=1 THEN loc1
You have almost spotted another reason your code did not work there is a clue in this line
IF ("C" = buf(9)) and ("9" = buf(8))THEN loc1
which indicates to me that you have worked it out.
I will leave that one as more food for thought.
Bookmarks