Multiple "For Next Loop" problem...
WaltsWorker
Posts: 1
Hello,
I'm running a BS2SX using the 2.2.5 software. I'm having a problem with the code executing the 'outer loop' - as it only goes though the 'inner loop.'
==================
Pump1:'Current pump time is 33 seconds
OUT2 = 0 ' Set Tally to Off
OUT15 = 1 ' turn on the pump!
FOR Pa = 1 TO 0 ' outter loop
FOR POn = 49999 TO 0 ' inner loop
NEXT
NEXT
OUT15 = 0 ' turn the pump off
===================
If I change "Pa = 1 TO 0" to any other number the time stays the same.
Thanks for any help!
I'm running a BS2SX using the 2.2.5 software. I'm having a problem with the code executing the 'outer loop' - as it only goes though the 'inner loop.'
==================
Pump1:'Current pump time is 33 seconds
OUT2 = 0 ' Set Tally to Off
OUT15 = 1 ' turn on the pump!
FOR Pa = 1 TO 0 ' outter loop
FOR POn = 49999 TO 0 ' inner loop
NEXT
NEXT
OUT15 = 0 ' turn the pump off
===================
If I change "Pa = 1 TO 0" to any other number the time stays the same.
Thanks for any help!
Comments
The code won't run as is. This will work.
' {$STAMP BS2}
' {$PBASIC 2.5}
a VAR Word
b VAR Word
DEBUG "test program",CR
FOR a = 1 TO 0
DEBUG "a=",DEC a,CR
FOR b = 49999 TO 0
IF b > 49990 OR b < 10 OR (b//1000) = 0 THEN DEBUG "b=",DEC b,CR
DEBUG "b=",DEC b,CR
ENDIF
NEXT
NEXT
DEBUG "all done",cr
stop
END[/code][/QUOTE]