For ... Step ... Next ... small addition, drastic help

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

For ... Step ... Next ... small addition, drastic help

Post by Shannara »

I think this falls along the line for the #PB_ANY Constant.. aka, a huge/drastic help...

I need a way to use a variable for a Step instead of a constant or a set Number. This little addition (that is in VB and other languages) would go a long way into allowing PB to handle dynamic equazions. (sp?). For example:

X1.l = SpriteWidth(DefaultSkin\Background)
Y1.l = SpriteHeight(DefaultSkin\Background)
For X=0 To myWidth Step X1
For Y=0 To myHeight Step Y1
DisplaySprite(DefaultSkin\Background, X, Y)
Next
Next

The above code is not possible because PB requires a constant or a Number. Not usefull for dynamic needs :(
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: For ... Step ... Next ... small addition, drastic help

Post by PB »

> I need a way to use a variable for a Step instead of a constant

viewtopic.php?p=49635
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Awesome, thank you :)
Post Reply