Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: Forged on November 06, 2004, 03:51 PM

Title: using for loops
Post by: Forged on November 06, 2004, 03:51 PM
how would you do
for(k =1; k<x; k++)

in vb?  I looked on yahoo and I didn't see anything on how you would do that.

and using search on this forum came up with any search that included the word for or loops
Title: Re: using for loops
Post by: MyndFyre on November 06, 2004, 03:53 PM
That's amazing!  I googled "visual basic for loops" and came up with:
http://www.programmershelp.co.uk/vbforloops.php
The FIRST result!

I had this code typed in first:

For k = 1 to x Step 1
' code
Next

Title: Re: using for loops
Post by: Newby on November 06, 2004, 03:54 PM
Quote from: MyndFyre on November 06, 2004, 03:53 PM
That's amazing!  I googled "visual basic for loops" and came up with:
http://www.programmershelp.co.uk/vbforloops.php
The FIRST result!
WTF? What's this google thingy you're talkin about? Must be the work of Satan.
Title: Re: using for loops
Post by: R.a.B.B.i.T on November 06, 2004, 03:58 PM
Quote from: MyndFyre on November 06, 2004, 03:53 PM
That's amazing!  I googled "visual basic for loops" and came up with:
http://www.programmershelp.co.uk/vbforloops.php
The FIRST result!

I had this code typed in first:

For k = 1 to x Step 1
' code
Next


Step 1 is redundant, because that is the default!
Title: Re: using for loops
Post by: Forged on November 06, 2004, 04:07 PM
Quote from: MyndFyre on November 06, 2004, 03:53 PM
That's amazing!  I googled "visual basic for loops" and came up with:
http://www.programmershelp.co.uk/vbforloops.php
The FIRST result!

I had this code typed in first:

For k = 1 to x Step 1
' code
Next



Guess I am using the wrong search engine :(

Thank you good sir.
Title: Re: using for loops
Post by: MyndFyre on November 06, 2004, 05:41 PM
Quote from: R.a.B.B.i.T on November 06, 2004, 03:58 PM
Step 1 is redundant, because that is the default!

Yes, step 1 is redundant, but the theory is if he wanted to go up by 2, he'd figure out that having "Step 1" there could be changed to "Step 2" later.  :P
Title: Re: using for loops
Post by: LivedKrad on November 06, 2004, 06:41 PM
No need to explain yourself. Redundancy is the way to go to insure that all possible routes are duely noted. (And, to be able to make one's self open to redundancy accusations).