Everything else that doesn't fall into one of the other PB categories.
Ralf
Enthusiast
Posts: 203 Joined: Fri May 30, 2003 1:29 pm
Location: Germany
Post
by Ralf » Tue Mar 22, 2005 12:41 am
what do you think about this? would you like to have the feature of variable expressions for STEP value instead only using #constants?
Code: Select all
;---- actual pure version - this works ----
FOR i = 0 TO 1024 STEP 64
your code...
NEXT
;---- add this feature / dont work in actual version ----
mystep = 1024/64 <<< STEP can ever be changed !!!
FOR i = 0 TO 1024 STEP mystep
your code...
NEXT
Hroudtwolf
Addict
Posts: 803 Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:
Post
by Hroudtwolf » Tue Mar 22, 2005 1:51 am
Thats a really good idea. I know this feature from QB and TurboBasic
dracflamloc
Addict
Posts: 1648 Joined: Mon Sep 20, 2004 3:52 pm
Contact:
Post
by dracflamloc » Tue Mar 22, 2005 2:28 am
Interesting. I'd like to see it
DarkDragon
Addict
Posts: 2344 Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:
Post
by DarkDragon » Tue Mar 22, 2005 7:10 am
And well, I'd like to have floats in the first variable, can you edit your post and add a second question?
bye,
Daniel
Tranquil
Addict
Posts: 952 Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe
Post
by Tranquil » Tue Mar 22, 2005 3:51 pm
Its allready possible:
Code: Select all
For N=0 to 2000:N+YourStepValue
Next n
Thats the same way you have to do it in C or C#. So, your suggestion is fine but not realy in need!
Cheers
Tranquil
Max.
Enthusiast
Posts: 225 Joined: Fri Apr 25, 2003 8:39 pm
Post
by Max. » Tue Mar 22, 2005 4:50 pm
Tranquil wrote: Its allready possible:
Code: Select all
For N=0 to 2000:N+YourStepValue
Next n
Thats the same way you have to do it in C or C#. So, your suggestion is fine but not realy in need!
Cheers
Maybe I missed something, but I expect using 10 as YourStepValue:
0, 10, 20, 30, ...
and not
11, 22, 33, 44 ...
Athlon64 3800+ · 1 GB RAM · Radeon X800 XL · Win XP Prof/SP1+IE6.0/Firefox · PB 3.94/4.0
Intel Centrino 1.4 MHz · 1.5 GB RAM · Radeon 9000 Mobility · Win XP Prof/SP2+IE6.0/Firefox · PB 3.94/4.0
Tension
User
Posts: 29 Joined: Tue Mar 22, 2005 3:19 pm
Post
by Tension » Tue Mar 22, 2005 4:55 pm
Perhaps because the loop is incrementing the index N by 1 and then yourStepValue is adding another 10?
Max.
Enthusiast
Posts: 225 Joined: Fri Apr 25, 2003 8:39 pm
Post
by Max. » Tue Mar 22, 2005 5:05 pm
Tension wrote: Perhaps because the loop is incrementing the index N by 1 and then yourStepValue is adding another 10?
Yep. It would work with
Code: Select all
YourStepValue = 10
For N=0 To 2000-YourStepValue Step 0:N+YourStepValue
Debug n
Next n
Athlon64 3800+ · 1 GB RAM · Radeon X800 XL · Win XP Prof/SP1+IE6.0/Firefox · PB 3.94/4.0
Intel Centrino 1.4 MHz · 1.5 GB RAM · Radeon 9000 Mobility · Win XP Prof/SP2+IE6.0/Firefox · PB 3.94/4.0
DoubleDutch
Addict
Posts: 3220 Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:
Post
by DoubleDutch » Tue Mar 22, 2005 11:38 pm
Wouldn't it be better...
Code: Select all
YourStepValue=10
For N=0 to 2000
Debug N
N+YourStepValue-1
Next N
This should be more similar to the results in other basics
Ralf
Enthusiast
Posts: 203 Joined: Fri May 30, 2003 1:29 pm
Location: Germany
Post
by Ralf » Thu Mar 24, 2005 12:06 pm
Tranquil wrote: Its allready possible:
Code: Select all
For N=0 to 2000:N+YourStepValue
Next n
Thats the same way you have to do it in C or C#. So, your suggestion is fine but not realy in need!
Cheers
Mike, in your example you can do user defined steps but if you write it this way, you get wrong results, because you add the YourStepValue before using/work with N inside the loop! So you have to put N-YourStepValue in end of the loop and this way is way known (i dont like this way)!
See DoubleDutch´s example... that would be correct as long as pure dont support it directly with STEP value
Ralf
Enthusiast
Posts: 203 Joined: Fri May 30, 2003 1:29 pm
Location: Germany
Post
by Ralf » Mon Jun 20, 2005 1:16 pm
Hi Fred!
Will you surprise us with this feature for 3.94 final?