Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
About using GOTO . . .
#31
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:
Reply
#32
D00d, are you calling me a n00b? omg! Smile
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
Reply
#33
: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.
Reply
#34
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.
Reply
#35
Now this is fun!!!!

:rotfl:
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#36
That is the bad side of QBasic being a recursive lingo... Sad 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)
Reply
#37
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.
Reply
#38
*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.
Reply
#39
Quote:That is the bad side of QBasic being a recursive lingo... Sad 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.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#40
(I appreciate the trouble you went to to find one without the worm. Smile )

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)