By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!TCC: R:\f.btm [41] Invalid array argument (out of bounds) "sel[%Y]"
R:\f.btm [41] Usage : IF [/I] [NOT] condition [.AND. | .OR. | .XOR. [NOT] condition ...] command
found: 0
Y: 5
S1: -1
Line: 50
Press any key when ready...
:TST
Set found=0
Set Y=0
REM DO UNTIL does't work, DO WHILE works
DO UNTIL %found eq 1 .OR. %Y eq %S1
Gosub Results
REM DO WHILE %found eq 0 .AND. %Y LE %S1
IF %sel[%Y] == %N Set found=1
Set Y=%@INC[Y]
ENDDO
RETURN
:Results
echo found: %found
echo Y: %Y
echo S1: %S1
echo Line: %_Batchline
pause
Return
TCC: R:\f.btm [41] Invalid array argument (out of bounds) "sel[%Y]"
Right, but if you want them to act the same except for the entry/exit difference you noted, the conditions should be logical opposites.DO WHILE and DO UNTIL are not logical opposites.
DO UNTIL %found == 1 .OR. %Y == %S1
Y == S1 and the body of the loop is executed. Thereafter, Y GT S1 and you can't get out of the loop (all the sel[*] being -1).c:\users\vefatica\desktop> f.btm
Zero
Two
Right, but if you want them to act the same except for the entry/exit difference you noted, the conditions should be logical opposites.