Page 1 of 1

For .. Step var

Posted: Sat Aug 07, 2004 5:23 pm
by KarLKoX

Code: Select all

nStep = 2
for x = 0 to 10 Step nStep

would be usefull :) (or it is a bug ?)

Re: For .. Step var

Posted: Sat Aug 07, 2004 7:09 pm
by CherokeeStalker
KarLKoX wrote:

Code: Select all

nStep = 2
for x = 0 to 10 Step nStep

would be usefull :) (or it is a bug ?)

You can already do this! See code below ...

x.s = ""
For i = 1 To 31 Step 2
x.s = x.s + Chr(10) + Str(i)
Next
MessageRequester("Info",x.s,0)
x.s = ""
For i = 30 To 0 Step -2
x.s = x.s + Chr(10) + Str(i)
Next
MessageRequester("Info",x.s,0)
End

Posted: Sat Aug 07, 2004 7:25 pm
by Kale
would be usefull (or it is a bug ?)
Its a limitation:
viewtopic.php?t=4930

Re: For .. Step var

Posted: Sat Aug 07, 2004 8:10 pm
by NoahPhense
KarLKoX wrote:

Code: Select all

nStep = 2
for x = 0 to 10 Step nStep

would be usefull :) (or it is a bug ?)
Needs to be a numberic constant or just a number.

Code: Select all

#nStep = 2 
For x = 0 To 10 Step #nStep 
Debug x
Next x
but yeah.. i guess if one needed to change the stepping during runtime
then it would be quite difficult.