wdmagic
- 24th February 2013, 13:00
I have a variable array, now I need to cycle thru it and set PORTB bits based on values in that array, heres my code
FOR CNT = 0 to 7
IF TEMP[CNT] < 100 then PORTB.CNT = 0
IF TEMP[CNT] >= 100 then PORTB.CNT = 1
NEXT CNT
Now "TEMP[CNT]" works fine, but it throws an error on "PORTB.CNT"
Error is Bad Variable Modifyer ".CNT"
I Changed it to PORTB.(CNT)
New Error, Bad Token "."
FOR CNT = 0 to 7
IF TEMP[CNT] < 100 then PORTB.CNT = 0
IF TEMP[CNT] >= 100 then PORTB.CNT = 1
NEXT CNT
Now "TEMP[CNT]" works fine, but it throws an error on "PORTB.CNT"
Error is Bad Variable Modifyer ".CNT"
I Changed it to PORTB.(CNT)
New Error, Bad Token "."