Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 26th Oct 2003 01:45
for i=1 to 3
for t=10 to 12
next t
next i
then technically the rotation goes like this...

i=1 t=10; i=1 t=11; i=1 t=12
i=2 t=10; i=2 t=11; i=2 t=12
i=3 t=10; i=3 t=11; i=3 t=12

So what happens if I go like this?
for i=1 to 3
for t=10 to 12
next i
next t

?????
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 26th Oct 2003 01:02
will that even compile?

-RUST-
Easily Confused
23
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 26th Oct 2003 01:05
Something missing there, me thinks.

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 26th Oct 2003 01:12
Yes it'll compile. Neither DB/DBpro bother to match the loop counter variable following the Next. It's doesn't change the nesting however. So you can use anything you like after the NEXT, it doesn't matter




Kevin Picone
Play Basic - Visible Worlds - Kyruss II
[url]www.underwaredesign.com[/url]
Scraggle
Moderator
23
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 26th Oct 2003 01:16 Edited at: 26th Oct 2003 01:18
When I first read your post I thought it was a daft question for two reasons:
1) It obviously won't compile.
2) It is so short a code, why not simply try it and find out.

However, I did try it and was very suprised to find that
a)It does compile.
b)It gives exactly the same result as your first example.

So your question is valid, although maybe phrased differently, not what happens if? but why?



Try this 'slightly' modified code to see for yourself:




[EDIT] uwdesign explains all whilst I am typing.
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th Oct 2003 01:34
I don't understand why the question was asked in the first place?!?!

I think you should use GOTO, this loop theory will never catch on, never mind nesting them.

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 26th Oct 2003 04:11
goto


-RUST-
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 26th Oct 2003 04:18
I came across this before

The variable after the next has no use (except it does serve the purpose of a sign post to tell you which "for" variable you were intending to increment.

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 26th Oct 2003 05:39 Edited at: 26th Oct 2003 06:02
hmm then it is of no use- if it does nothing really?
I've never used it, but I've seen that DBPRo compiles it.
I was thinking maybe I could add a new calculation, but I think it is worthless to do such a thing.

Thank you!,

ICERGB

Here is a working sample;


(By the way, this is because -if you get multiplayer stats from DBPro they are going to be all over the place.)
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 26th Oct 2003 05:45
ICERB
How could you ever Program without using "a for next loop"?

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 26th Oct 2003 05:50 Edited at: 26th Oct 2003 06:16
for next loops sometimes make me stare for days,- but I get them!

At least I try to!

really hard

Login to post a reply

Server time is: 2026-07-26 17:35:47
Your offset time is: 2026-07-26 17:35:47