STEP Value.l

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

STEP Value.l

Post by Hroudtwolf »

Hello Fred and PureBasic-Team,

I have a great wish again.... :-)
Please, make it possible to use a 'Long' with 'STEP'.
It would be very, very useful.

Code: Select all

  For x=1 To 100 Step value.l
  Next x
Best regards

Hroudtwolf
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

While you're waiting, here's a macro for you:

Code: Select all

Macro NextStep(Variable, Value)
  Variable + Value-1
  Next
EndMacro

For I = 1 To 2048
  Debug I
NextStep(I, I)
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

Cool idea.
Thx.
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

This is also a preliminary solution...

Code: Select all

Macro ExtraFor (var,Counter,CountTo,InSteps)
  For var=Counter-InSteps To CountTo-InSteps Step 0
  var+InSteps
EndMacro

OpenConsole ()
test=10
ExtraFor (x,0,100, test)
  PrintN(Str(x))
Next x
Input()
CloseConsole () 
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

this has been wished x times now. let us wait for monday, when you will hold a new version in your hand and possibility support floats for loops too. :twisted:
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Post Reply