Project

General

Profile

Actions

Bug #280

closed

For loop misses first iteration in some cases.

Added by Brian Flanagan over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
03/01/2020
Due date:
% Done:

0%

Estimated time:
Affected version:

Description

For loops should ALWAYS complete the first iteration (even if the Step is in the wrong direction), but in AOZ they don't.
(This is probably related to bug #259. I've included a similar example here.)
I'm guessing this is because the comparison is being done at the For instead of at the Next, as it should be.

In the 3 test cases shown in the following example, AOZ fails the first (and only) iteration:

#manifest:"pc"
#splashScreen:false

Print "2 To 1"
For x=2 To 1
  print x
Next x

Print "1 To 2 Step -1"
For x=1 To 2 Step -1
    Print x
Next x

Print "1 To 1"
For x=1 To 1
    Print x
Next x

Print "Done"

Results (FAIL):

2 To 1
1 To 2 Step -1
1 To 1
Done

Result SHOULD be:

2 To 1
 2
1 To 2 Step -1
 1
10 To 10
 10
Done


Related issues 1 (0 open1 closed)

Related to AOZ Studio V1 (TBD bugs clean/-> V2) - Bug #259: For...Next from 1 to 1 doesn't enter the loopClosedFrancois Lionet02/27/2020

Actions
Actions

Also available in: Atom PDF