If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

the idea with number of iterations instead of step for some cases is neat, the local variable as well!

But I have to add few insights regarding the syntax.

Functions with multiple parameters are confusing, especially those booleans. It is mentioned multiple times in Pragmatic Programmer and Code Complete - I would also vote to avoid such a designs, although I made similar mistakes in the past. Just have a look at TBGL_SetupLightSource... yikes!

Also - while I am the last person to insist on inheriting legacy BASIC syntax, I like to keep "basic" as the design rule to lead us to the future.

When you look at these:

for i = 2 to 8 step 4
print "Ciao" At 10, 5

... you are immediately oriented.

When you see:

fFori 0.1, 0.9, 5, true

... you need to think twice.

So for the local variable, I would go this route:

for single f = 1 to 10

...and for the implied number of iterations:

for f = 1 to 10 in 5 steps

(for example)

-

Do you remember? ThinBASIC had this implemented, not sure where it got lost (Eros?):

for i as long = 1 to 10
next
for i = 2 to 8
next

So... you see, the i gets declared as part of first cycle and can be recycled in second.

Advantages?

No variable deallocation at end of each cycle brings more performance.

Loop variable supporting FOR/NEXT can be declared on the fly but it is not removed afterwards due to time it takes to de-allocate it.

Personally I'm with Petr when he says we need to remain with BASIC syntax as much as possible even if I like to add some "contamination" if they are useful to the programmer and bring some execution advantages/speed.
I hate short variable declaration, I like long names for variables
I like code to be able to be read after many years without double concentration to follow variable meaning.