Bad token error in compile
Hi guys , not seen this error before but i think i know why it s just dont know how to sort it , what is the best way for this bit of code
1. requirement - build a word consisting of 16 bits of flags ,
aim to store bit flags into the word , pointing to each bit in the word and save the flag as it goes during a for , next loop , where the T points to the bit to be saved
note this just part example ,that generates the bad token error ?
cheers
Sheldon
Code:
Fault var word
T var byte
for T = 1 to 16 ' 0 not used so value lines up with correct input sensor number
Fault.(T-1) = 0 ' Clear bit 0 ready for new input during loop - (T-1 ) done to align to bit 0 of fault word varable
next T
Re: Bad token error in compile
Hi,
Try this:
Code:
for T = 1 to 16 ' 0 not used so value lines up with correct input sensor number
Fault.0[T-1] = 0 ' Clear bit 0 ready for new input during loop - (T-1 ) done to align to bit 0 of fault word varable
next T
For more info, see Melanies writeup.
/Henrik.
Re: Bad token error in compile
thanks hendric, thought the T value would be enough , why is not
Re: Bad token error in compile
ah that was good read , cheers for that hendric , melanies write up was good to review