Posts: 1,138
Threads: 211
Joined: Feb 2020
Goto: use it but don't abuse it ;-)
Glenn: I've started to think about giving Blitz a custom rank, kinda like personal trainer but actual name of personal aggrevator.
Blitz: Is your posting style self taught or did you have to learn how to be so combatant? :rotfl: Could I interest you in a custom rank of "n00bie"? :bounce:
Posts: 788
Threads: 53
Joined: Nov 2002
D00d, are you calling me a n00b? omg!
Nah, it took years of training. I had to go up in the mountain in tibet and live with the munks for years.
oship me and i will give you lots of guurrls and beeea
Posts: 3,368
Threads: 195
Joined: Jan 2003
:rotfl:
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 704
Threads: 0
Joined: Dec 2002
How many people think that people who show pictures of food in their "avatar" should have to throw a party and feed all the people they've made hungry?
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Posts: 3,288
Threads: 167
Joined: Nov 2001
Now this is fun!!!!
:rotfl:
Posts: 3,343
Threads: 83
Joined: Mar 2003
That is the bad side of QBasic being a recursive lingo...
Why are you even in 27 nested loops anyways? Don't forget that using GOTO in this situation leaves the 27 loops on the stack clogging up your precious stack space.
Edit: This was designed as a reply to nathan (see p1)
Posts: 704
Threads: 0
Joined: Dec 2002
of nested IF THEN/ELSE constructs. (I don't see why the stack would be involved at all. Such constructs usually get translated to jump instructions.) The reason such large nested structures are used is likely because people are trying to avoid GOTO. There aren't any rules regarding how deep of a nesting level might be required by any given application. The application determines that, not bureaucrats. (And nested IF THEN/ELSE constructs isn't recursion.)
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Posts: 3,368
Threads: 195
Joined: Jan 2003
*hands Glenn an apple*
A gosub/return SHOULD be translated as 2 GOTOs.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 6,419
Threads: 74
Joined: Mar 2002
Quote:That is the bad side of QBasic being a recursive lingo... Why are you even in 27 nested loops anyways? Don't forget that using GOTO in this situation leaves the 27 loops on the stack clogging up your precious stack space.
Edit: This was designed as a reply to nathan (see p1)
I have never seen loops which use the stack for any purposes. Stacks are used in PROC calls (assembly), which are more or less functions and subroutines.
You can test it by yourself. Write something like:
Code:
WHILE i%>0
FOR j%=0 TO 7
FOR k%=7 TO -100 STEP -3
DO
FOR h%=1 TO 1000
WHILE amber%>100
amber%=amber%+1
IF j%+amber%>=h% THEN GOTO ending
k$=INKEY$
WEND
NEXT h%
LOOP WHILE INKEY$=""
NEXT k%
NEXT j%
i%=i%+1
WEND
ending:
PRINT "Exit"
And generate the assembly listing. You'll notice no PROC calls, so no stack involved.
Posts: 704
Threads: 0
Joined: Dec 2002
(I appreciate the trouble you went to to find one without the worm.
)
Well, yes, a GOSUB/RETURN would involve two jumps, but that *would* use the STACK.
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.