cannot maintain variables in the subs
cannot maintain variables in the subs
I am creating a program in QBASIC and am stuck. Here is my program:
>
> DECLARE SUB ending ()
> DECLARE SUB menu ()
>
> CLS
> PRINT "Please select from the menu below any thing you wish to order (type the PRICE of the item you wish to order)"
> PRINT "An externel Floppy drive 46.99$"
> PRINT "An external CD-ROM drive 72.55$"
> PRINT "An external DVD-ROM drive 99.99$"
> PRINT "An external CD/DVD-ROM combo burner drive 255.68$"
> PRINT "50 blank 80 minute CD-ROMs 25.32$"
> PRINT "50 blank 100 minute CD-ROMs 32.25$"
> PRINT "50 blank 100 minute DVDs 100.00$"
> PRINT "50 blank floppies 25.55$"
> PRINT "300 sheets of recycled computer paper 2.99$"
> PRINT "300 sheets of computer cardstock 4.99$"
> PRINT "300 sheets of bright computer paper 3.50$"
> INPUT order%
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order2%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount2%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order3%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount3%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order4%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount4%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order5%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount5%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order6%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount6%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order7%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount7%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order8%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount8%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order9%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount9%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order10%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount10%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order11%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount11%
> price% = order% * amount%
> price2% = order2% * amount2%
> price3% = order3% * amount3%
> price4% = order4% * amount4%
> price5% = order5% * amount5%
> price6% = order6% * amount6%
> price7% = order7% * amount7%
> price8% = order8% * amount8%
> price9% = order9% * amount9%
> price10% = order10% * amount10%
> price11% = order11% * amount11%
> subtotal% = price% + price2% + price3% + price4% + price5% + price6% +
> price7% + price8% + price9% + price10% + price11% PRINT "total of this
> order "; price%
>
> PRINT "total of this order "; price2%
>
> PRINT "total of this order "; price3%
>
> PRINT "total of this order "; price4%
>
> PRINT "total of this order "; price5%
>
> PRINT "total of this order "; price6%
>
> PRINT "total of this order "; price7%
>
> PRINT "total of this order "; price8%
>
> PRINT "total of this order "; price9%
>
> PRINT "total of this order "; price10%
>
> PRINT "total of this order "; price11% PRINT PRINT "Your subtotal
> comes to:"
> PRINT subtotal%
> tax% = subtotal% * .0875
> PRINT "Your tax comes to:"
> PRINT tax%
> total% = subtotal% + tax%
> PRINT "Your total comes to:"
> PRINT total%
> PRINT "Press enter to continue"
> INPUT enter$
>
> CLS
> PRINT "Hello my name is compu. I am the computerized version of our buisness. I take over after you have made your order."
> SLEEP 25
> CLS
> PRINT "What is your full first name"
> INPUT name$
> SLEEP 1
> DO
> CLS
> PRINT "Hello "; name$; "!!!"
> SLEEP 2
> CLS
> PRINT name$; "You must take a short survey in order to purchase this product so we may have your information on file to send the product to you. Do you wish to continue"
> INPUT survey$
> IF survey$ = "N" OR survey$ = "n" OR survey$ = "no" THEN END
> CLS
> SLEEP 2
> PRINT "What is your middle name"
> INPUT middle$
> CLS
> SLEEP 1
> PRINT "What is your last name"
> INPUT last$
> CLS
> SLEEP 1
> PRINT "What is your address"
> INPUT address$
> CLS
> SLEEP 1
> PRINT "What city do you live in"
> INPUT city$
> CLS
> SLEEP 1
> PRINT "What state do you live in"
> INPUT state$
> CLS
> SLEEP 1
> PRINT "What is your zipcode"
> INPUT zipcode
> CLS
> SLEEP 1
> PRINT "What is your current age in years"
> INPUT years%
> CLS
> SLEEP 1
> PRINT "We are now processing your entry. Your cooperation has been appriciated. Please be patient."
> SLEEP 6
> CLS
> PRINT "Please check your information below:"
> PRINT "Your full name is "; name$; " "; middle$; " "; last$
> PRINT "You live at "
> PRINT ; address$
> PRINT city$; ", "; state$; " "; zipcode
> months% = years% * 12
> days% = years% * 365
> PRINT "You are "; years%; " years old"
> PRINT "You are "; months%; " months old"
> PRINT "You are "; days%; " days old"
> PRINT "Is this correct? (Y or N)"
> INPUT Answer$
> LOOP UNTIL Answer$ = "Y" OR Answer$ = "y" OR Answer$ = "yes"
> CLS
> PRINT "Thank you for your cooperation in the signing of our optional hit list, "; name$; "."
> PRINT "Please allow 24 to 36 hours for the processing of the hitman which we will send to your house."
> SLEEP 17
> CLS
> SCREEN 7
> CIRCLE (100, 100), 50, 14
> PSET (80, 80), 1
> PSET (120, 80), 1
> PSET (100, 100), 6
> LINE (75, 110)-(85, 125), 4
> LINE (85, 125)-(100, 130), 4
> LINE (100, 130)-(115, 125), 4
> LINE (115, 125)-(125, 110), 4
> SOUND 261.63, (1 * 5)
> SOUND 293.66, (1 * 5)
> SOUND 329.63, (1 * 5)
> SOUND 349.23, (1 * 15)
> SOUND 261.63, (1 * 5)
> SOUND 293.66, (1 * 5)
> SOUND 329.63, (1 * 5)
> SOUND 349.23, (1 * 20)
> SOUND 329.63, (1 * 5)
> SOUND 293.66, (1 * 5)
> SOUND 261.63, (1 * 15)
> SOUND 261.63, (1 * 10)
> SOUND 293.66, (1 * 10)
> SOUND 329.63, (1 * 10)
> SOUND 349.23, (1 * 10)
> PRINT "Thank you and have a wonderful day "; name$; "!!!"
>
> SUB ending
> price% = order% * amount%
> price2% = order2% * amount2%
> price3% = order3% * amount3%
> price4% = order4% * amount4%
> price5% = order5% * amount5%
> price6% = order6% * amount6%
> price7% = order7% * amount7%
> price8% = order8% * amount8%
> price9% = order9% * amount9%
> price10% = order10% * amount10%
> price11% = order11% * amount11%
> subtotal% = price% + price2% + price3% + price4% + price5% + price6% +
> price7% + price8% + price9% + price10% + price11% PRINT "total of this
> order "; price%
>
> PRINT "total of this order "; price2%
>
> PRINT "total of this order "; price3%
>
> PRINT "total of this order "; price4%
>
> PRINT "total of this order "; price5%
>
> PRINT "total of this order "; price6%
>
> PRINT "total of this order "; price7%
>
> PRINT "total of this order "; price8%
>
> PRINT "total of this order "; price9%
>
> PRINT "total of this order "; price10%
>
> PRINT "total of this order "; price11% PRINT PRINT "Your subtotal
> comes to:"
> PRINT subtotal%
> tax% = subtotal% * .0875
> PRINT "Your tax comes to:"
> PRINT tax%
> total% = subtotal% + tax%
> PRINT "Your total comes to:"
> PRINT total%
> PRINT "Press enter to continue"
> INPUT enter$
>
> END SUB
>
> SUB menu
> CLS
> PRINT "Please select from the menu below any thing you wish to order (type the PRICE into the blank)"
> PRINT "An externel Floppy drive 46.99$"
> PRINT "An external CD-ROM drive 72.55$"
> PRINT "An external DVD-ROM drive 99.99$"
> PRINT "An external CD/DVD-ROM combo burner drive 255.68$"
> PRINT "50 blank 80 minute CD-ROMs 25.32$"
> PRINT "50 blank 100 minute CD-ROMs 32.25$"
> PRINT "50 blank 100 minute DVDs 100.00$"
> PRINT "50 blank floppies 25.55$"
> PRINT "300 sheets of recycled computer paper 2.99$"
> PRINT "300 sheets of computer cardstock 4.99$"
> PRINT "300 sheets of bright computer paper 3.50$"
>
> END SUB
>
> My problem is that I cannot use my prices in my sub. I am really confused!!!!! I need to carry over my information. HELP?
>
> DECLARE SUB ending ()
> DECLARE SUB menu ()
>
> CLS
> PRINT "Please select from the menu below any thing you wish to order (type the PRICE of the item you wish to order)"
> PRINT "An externel Floppy drive 46.99$"
> PRINT "An external CD-ROM drive 72.55$"
> PRINT "An external DVD-ROM drive 99.99$"
> PRINT "An external CD/DVD-ROM combo burner drive 255.68$"
> PRINT "50 blank 80 minute CD-ROMs 25.32$"
> PRINT "50 blank 100 minute CD-ROMs 32.25$"
> PRINT "50 blank 100 minute DVDs 100.00$"
> PRINT "50 blank floppies 25.55$"
> PRINT "300 sheets of recycled computer paper 2.99$"
> PRINT "300 sheets of computer cardstock 4.99$"
> PRINT "300 sheets of bright computer paper 3.50$"
> INPUT order%
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order2%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount2%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order3%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount3%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order4%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount4%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order5%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount5%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order6%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount6%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order7%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount7%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order8%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount8%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order9%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount9%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order10%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount10%
> PRINT "Would you like to order anything else?"
> INPUT wouldyou$
> IF wouldyou$ = "y" OR wouldyou$ = "Y" OR wouldyou$ = "yes" THEN menu
> INPUT order11%
>
> CLS
> PRINT "How much would you like (do not spell out numbers)"
> INPUT amount11%
> price% = order% * amount%
> price2% = order2% * amount2%
> price3% = order3% * amount3%
> price4% = order4% * amount4%
> price5% = order5% * amount5%
> price6% = order6% * amount6%
> price7% = order7% * amount7%
> price8% = order8% * amount8%
> price9% = order9% * amount9%
> price10% = order10% * amount10%
> price11% = order11% * amount11%
> subtotal% = price% + price2% + price3% + price4% + price5% + price6% +
> price7% + price8% + price9% + price10% + price11% PRINT "total of this
> order "; price%
>
> PRINT "total of this order "; price2%
>
> PRINT "total of this order "; price3%
>
> PRINT "total of this order "; price4%
>
> PRINT "total of this order "; price5%
>
> PRINT "total of this order "; price6%
>
> PRINT "total of this order "; price7%
>
> PRINT "total of this order "; price8%
>
> PRINT "total of this order "; price9%
>
> PRINT "total of this order "; price10%
>
> PRINT "total of this order "; price11% PRINT PRINT "Your subtotal
> comes to:"
> PRINT subtotal%
> tax% = subtotal% * .0875
> PRINT "Your tax comes to:"
> PRINT tax%
> total% = subtotal% + tax%
> PRINT "Your total comes to:"
> PRINT total%
> PRINT "Press enter to continue"
> INPUT enter$
>
> CLS
> PRINT "Hello my name is compu. I am the computerized version of our buisness. I take over after you have made your order."
> SLEEP 25
> CLS
> PRINT "What is your full first name"
> INPUT name$
> SLEEP 1
> DO
> CLS
> PRINT "Hello "; name$; "!!!"
> SLEEP 2
> CLS
> PRINT name$; "You must take a short survey in order to purchase this product so we may have your information on file to send the product to you. Do you wish to continue"
> INPUT survey$
> IF survey$ = "N" OR survey$ = "n" OR survey$ = "no" THEN END
> CLS
> SLEEP 2
> PRINT "What is your middle name"
> INPUT middle$
> CLS
> SLEEP 1
> PRINT "What is your last name"
> INPUT last$
> CLS
> SLEEP 1
> PRINT "What is your address"
> INPUT address$
> CLS
> SLEEP 1
> PRINT "What city do you live in"
> INPUT city$
> CLS
> SLEEP 1
> PRINT "What state do you live in"
> INPUT state$
> CLS
> SLEEP 1
> PRINT "What is your zipcode"
> INPUT zipcode
> CLS
> SLEEP 1
> PRINT "What is your current age in years"
> INPUT years%
> CLS
> SLEEP 1
> PRINT "We are now processing your entry. Your cooperation has been appriciated. Please be patient."
> SLEEP 6
> CLS
> PRINT "Please check your information below:"
> PRINT "Your full name is "; name$; " "; middle$; " "; last$
> PRINT "You live at "
> PRINT ; address$
> PRINT city$; ", "; state$; " "; zipcode
> months% = years% * 12
> days% = years% * 365
> PRINT "You are "; years%; " years old"
> PRINT "You are "; months%; " months old"
> PRINT "You are "; days%; " days old"
> PRINT "Is this correct? (Y or N)"
> INPUT Answer$
> LOOP UNTIL Answer$ = "Y" OR Answer$ = "y" OR Answer$ = "yes"
> CLS
> PRINT "Thank you for your cooperation in the signing of our optional hit list, "; name$; "."
> PRINT "Please allow 24 to 36 hours for the processing of the hitman which we will send to your house."
> SLEEP 17
> CLS
> SCREEN 7
> CIRCLE (100, 100), 50, 14
> PSET (80, 80), 1
> PSET (120, 80), 1
> PSET (100, 100), 6
> LINE (75, 110)-(85, 125), 4
> LINE (85, 125)-(100, 130), 4
> LINE (100, 130)-(115, 125), 4
> LINE (115, 125)-(125, 110), 4
> SOUND 261.63, (1 * 5)
> SOUND 293.66, (1 * 5)
> SOUND 329.63, (1 * 5)
> SOUND 349.23, (1 * 15)
> SOUND 261.63, (1 * 5)
> SOUND 293.66, (1 * 5)
> SOUND 329.63, (1 * 5)
> SOUND 349.23, (1 * 20)
> SOUND 329.63, (1 * 5)
> SOUND 293.66, (1 * 5)
> SOUND 261.63, (1 * 15)
> SOUND 261.63, (1 * 10)
> SOUND 293.66, (1 * 10)
> SOUND 329.63, (1 * 10)
> SOUND 349.23, (1 * 10)
> PRINT "Thank you and have a wonderful day "; name$; "!!!"
>
> SUB ending
> price% = order% * amount%
> price2% = order2% * amount2%
> price3% = order3% * amount3%
> price4% = order4% * amount4%
> price5% = order5% * amount5%
> price6% = order6% * amount6%
> price7% = order7% * amount7%
> price8% = order8% * amount8%
> price9% = order9% * amount9%
> price10% = order10% * amount10%
> price11% = order11% * amount11%
> subtotal% = price% + price2% + price3% + price4% + price5% + price6% +
> price7% + price8% + price9% + price10% + price11% PRINT "total of this
> order "; price%
>
> PRINT "total of this order "; price2%
>
> PRINT "total of this order "; price3%
>
> PRINT "total of this order "; price4%
>
> PRINT "total of this order "; price5%
>
> PRINT "total of this order "; price6%
>
> PRINT "total of this order "; price7%
>
> PRINT "total of this order "; price8%
>
> PRINT "total of this order "; price9%
>
> PRINT "total of this order "; price10%
>
> PRINT "total of this order "; price11% PRINT PRINT "Your subtotal
> comes to:"
> PRINT subtotal%
> tax% = subtotal% * .0875
> PRINT "Your tax comes to:"
> PRINT tax%
> total% = subtotal% + tax%
> PRINT "Your total comes to:"
> PRINT total%
> PRINT "Press enter to continue"
> INPUT enter$
>
> END SUB
>
> SUB menu
> CLS
> PRINT "Please select from the menu below any thing you wish to order (type the PRICE into the blank)"
> PRINT "An externel Floppy drive 46.99$"
> PRINT "An external CD-ROM drive 72.55$"
> PRINT "An external DVD-ROM drive 99.99$"
> PRINT "An external CD/DVD-ROM combo burner drive 255.68$"
> PRINT "50 blank 80 minute CD-ROMs 25.32$"
> PRINT "50 blank 100 minute CD-ROMs 32.25$"
> PRINT "50 blank 100 minute DVDs 100.00$"
> PRINT "50 blank floppies 25.55$"
> PRINT "300 sheets of recycled computer paper 2.99$"
> PRINT "300 sheets of computer cardstock 4.99$"
> PRINT "300 sheets of bright computer paper 3.50$"
>
> END SUB
>
> My problem is that I cannot use my prices in my sub. I am really confused!!!!! I need to carry over my information. HELP?
- {Nathan}
- Veteran
- Posts: 1169
- Joined: Thu Aug 19, 2004 6:08 pm
- Location: The wetlands of central Ohio, USA
- Contact:
Also, this is a MUCH better way of doing menus for noobs.
Or, what I sometimes do is put the choices in an array and use UBOUND and LBOUND to get the maximum stuff, CODE IS UNTESTED!!! (Should work though)
Code: Select all
DEFINT A-Z
CLS
TotalChoices = 3
PlayerPlace = 1
DO
PRINT " Player Game" 'Notice the space
PRINT " Help"
PRINT " Quit"
A$ = INKEY$
IF A$ = "" THEN
DO
A$ = INKEY$ 'Make sure A$ has something
LOOP UNTIL A$ <> ""
ENDIF
' There is an ASCII char, but I dont know it. For an arrow I will use a )
IF UCASE$(A$) = "I" AND PlayerPlace <> TotalChoices THEN PlayerPlace = PlayerPlace - 1
IF UCASE$(A$) = "K" AND PlayerPlace <> 1 THEN PlayerPlace = PlayerPlace + 1
LOCATE 0, PlayerChoice
PRINT ")"
LOOP UNTIL A$ = " "
HOLY SH**!!!!
I haven't seen this bad programming since I first started out.
Making a program like that is VERY limited and VERY time
consuming.
PLEASE do your self a favor and learn the blessings
of ARRAYS and LOOPS.
Also NEVER use GOTO, even though you didn't use it
NEVER use it in your programs. It gets very complicated to
debug and is "stringy". I put this in here because noobs
have a habit of using those.
You cannot write good programs until you learn the
essentails, specificaly Loops and Arrays. There are also
many other commands that are necessy but thats why
there is a help file. I'm sorry if this message appeared to be
cutting you down, which there was no intent, but you REALLY need to learn these things fast. Also I have this strange feeling that you are learning
QB in a class...
-Mit
I haven't seen this bad programming since I first started out.
Making a program like that is VERY limited and VERY time
consuming.
PLEASE do your self a favor and learn the blessings
of ARRAYS and LOOPS.
Also NEVER use GOTO, even though you didn't use it
NEVER use it in your programs. It gets very complicated to
debug and is "stringy". I put this in here because noobs
have a habit of using those.
You cannot write good programs until you learn the
essentails, specificaly Loops and Arrays. There are also
many other commands that are necessy but thats why
there is a help file. I'm sorry if this message appeared to be
cutting you down, which there was no intent, but you REALLY need to learn these things fast. Also I have this strange feeling that you are learning
QB in a class...
-Mit
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
I used GOTO over 126 times in Robo Raider(Classic style), I also used few other statements over 126 times,.. some I could have made a CALL for so not to use so many, but GOTO is what controls the door codes in the mazes, and also that annoying crash code,... annoying, what am I saying, I wrote that, oh sorry, talking 2 meself, hehe!
Also the Batt. code, that one was nice though, gives you 30mins, or it ment to, goes off LOOP speed.. can't remember how many LOOP per second 7.1 made,. sorry it wont load into QB 1.1, it'd give you more time, its LOOP speed is slow.
I'm chaining Space Warp though, making sure I can compile that 1 .
Also the Batt. code, that one was nice though, gives you 30mins, or it ment to, goes off LOOP speed.. can't remember how many LOOP per second 7.1 made,. sorry it wont load into QB 1.1, it'd give you more time, its LOOP speed is slow.
I'm chaining Space Warp though, making sure I can compile that 1 .
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
(x.t.r.GRAPHICS)
Hi,
As I said before I was not trying to be harsh on the guy,
just that his life could be SOOOOO much easier.
Also GOTO is a habit you should get out of. Use
Do LOOPs to compensate instead because GOTO is
really hard to debug and not considered a
good way to code.
-Mit
P.S. I never ment that you were a noob Z!re
As I said before I was not trying to be harsh on the guy,
just that his life could be SOOOOO much easier.
Also GOTO is a habit you should get out of. Use
Do LOOPs to compensate instead because GOTO is
really hard to debug and not considered a
good way to code.
-Mit
P.S. I never ment that you were a noob Z!re
Read my other response about GOTO. But judging someone's coding technique is not our responsibility, nor is it ever wanted or even called for. Everyone codes differently, it's about as unique as our fingerprints. Judging someone's coding style is immoral enough, but outright insulting it is cause for major flames. I hope you brought a pair of asbestos underpants, coz if you keep going this way, you're gonna need 'em in short order.
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
Aye, you'd have to do more than complain about GOTO's to cause ne level of hate n me, and then after that, I hate very little of anything, its a waste of time to go round hating.
As for the others, they seem nice, I havn't crossed ne yet, n tg they havn't crossed me (which is also hard 2 do, although I can get fired up easily )
Oh well, I use GOTO, n u don't, we'll leave it there,
As for the others, they seem nice, I havn't crossed ne yet, n tg they havn't crossed me (which is also hard 2 do, although I can get fired up easily )
Oh well, I use GOTO, n u don't, we'll leave it there,
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
(x.t.r.GRAPHICS)
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
Give it up.
Goto is there for a reason, it can be found in almost any language.
And no matter what you do, you'll end up using "goto" anyways, in the form of jmp in ASM
A goto can shorten your code dramatically, example:
Versus:
Should you or me count lines/readability?
Can't you just accept the fact that people code differently?
For example I never comment my code, ever. Everyone says it's bad coding, so?, I don't care, I don't need any comments to remember what my code does, and if I share it in a multi-programmer project, I explain if they don't get it. So far, they have understood without any problems. Oh, and I use GOTO.
Goto is there for a reason, it can be found in almost any language.
And no matter what you do, you'll end up using "goto" anyways, in the form of jmp in ASM
A goto can shorten your code dramatically, example:
Code: Select all
Flag = 0
For a = 0 To 1000
For b = 0 To 1000
For c = 0 To 1000
For d = 0 To 1000
If a = 5 And b = 10 And c = 833 And d = 162 Then Flag = 1
If Flag = 1 Then Exit For
Next
If Flag = 1 Then Exit For
Next
If Flag = 1 Then Exit For
Next
If Flag = 1 Then Exit For
Next
If Flag = 0 Then
Print "ERROR"
End
End If
Code: Select all
For a = 0 To 1000
For b = 0 To 1000
For c = 0 To 1000
For d = 0 To 1000
If a = 5 And b = 10 And c = 833 And d = 162 Then Goto EndNest
Next
Next
Next
Next
Print "ERROR"
End
EndNest:
Can't you just accept the fact that people code differently?
For example I never comment my code, ever. Everyone says it's bad coding, so?, I don't care, I don't need any comments to remember what my code does, and if I share it in a multi-programmer project, I explain if they don't get it. So far, they have understood without any problems. Oh, and I use GOTO.
I have left this dump.
Ok Z!re, I think I already established that I understood
the benifits of GOTO, and was not going to comment
anymore about people's bad habits. That said I
DID give it up and you are the one who just brought it back.
I want to make it clear now that I was sorry to critizise,
understand that GOTOs could be good, and don't want to
hear about the GOTO thing ever again, PLEASE give me a
break! Just don't expect to see any GOTOs in my programs .
-Mit
the benifits of GOTO, and was not going to comment
anymore about people's bad habits. That said I
DID give it up and you are the one who just brought it back.
I want to make it clear now that I was sorry to critizise,
understand that GOTOs could be good, and don't want to
hear about the GOTO thing ever again, PLEASE give me a
break! Just don't expect to see any GOTOs in my programs .
-Mit