Step in For loop to accept an expression
Step in For loop to accept an expression
I'd like to see step For/Next loops accept an expression or at least a variable. The step value isn't always a constant.
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
+1
(Btw, there are any number of syntactical constructs for "for" loops and some of these appear to allow variables as step.
Some do not even use the keyword "for" but are "for" loops as we know them. And some even appear to give a list of values for the step.
So, to nitpick, I think step does not always have to be a constant, that is, there is not some legal or physical or religious law that governs this.
)
(Btw, there are any number of syntactical constructs for "for" loops and some of these appear to allow variables as step.
Some do not even use the keyword "for" but are "for" loops as we know them. And some even appear to give a list of values for the step.
So, to nitpick, I think step does not always have to be a constant, that is, there is not some legal or physical or religious law that governs this.

Dare2 cut down to size
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
sure, but in PB it is, like the Loopcounter has to be a Long, which is also uncommon in most other BASIC dialects.
the For-Loop in PB is a Bloody simple Loop, maybe for performance reasons, maybe because it's a stepchild.
anyhow, I think there are tons of more important improvements to do than pimping up the "stepchild"-Loop....
the For-Loop in PB is a Bloody simple Loop, maybe for performance reasons, maybe because it's a stepchild.
anyhow, I think there are tons of more important improvements to do than pimping up the "stepchild"-Loop....
oh... and have a nice day.