Is it correct to do the following:
abc var word[2]
abc=0
loop:
abc=abc+1
if abc=80000 then
high LED
abc=0
endif
goto loop
Printable View
Is it correct to do the following:
abc var word[2]
abc=0
loop:
abc=abc+1
if abc=80000 then
high LED
abc=0
endif
goto loop
Hi,
No, that's not OK. If you have PBP250 or above you can use longs (switch compiler to PBPL) and do:If you don't have PBPL you can either use N-bit-Math (Darrels math routines) or do something like (not tested)Code:abc VAR LONG 'Declare abc as a 32bit variable
Also, note that the word Loop is a reseved word in newer versions of PBP.Code:abc var WORD
abc_ten_thousands VAR WORD
MainLoop:
abc = abc + 1
If abc = 10000 then
abc_ten_thousands = abc_ten_thousands + 1
abc = 0
Endif
If abc ten_thousands = 80 then
High LED
abc = 0
abc_ten_thousands = 0
EndIf
Goto MainLoop