Page 1 of 1

Posted: Mon Apr 07, 2003 2:56 am
by BackupUser
Restored from previous forum. Originally posted by Jose.

@Fred
Most languages allow you to use an expression in the STEP part of a FOR-NEXT loop.

This code shows the problem;

Code: Select all

#MYSTEP = 20
nMax.l = 20

For n = 0 To 100 Step #MYSTEP ;this works
  Debug n
Next

;------------THIS FAILS AT COMPILE --------------
For n = 0 To 100 Step nMax
  Debug n
Next
;------------THIS FAILS AT COMPILE --------------

; In the help it says
;
;   For  =  To  [Step ]
;     ...
;   Next []

;Note, that this also works
For n = 0 To 100 Step 20 ;this works
  Debug n
Next
so my request, Fred can we PLEASE have support for
;For = To [Step ]

Many Thanks