cannot maintain variables in the subs

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

:? He did say he was going to stop!,. as for tar n feathers, tar is hot, n feathers arn't the fashion now and days... I 4 1 was once in his shoes and spoke out on something, on a diff topic :wink:. I left the board to, I lost put it that way, not that I was trying to win..

Hate to get on your bad side Z!re, and judging by you avatar I won't b the first, :P , but there no since knocking some1 over 1 statment, now if he knocked QB, more power 2 u, LETs just drop it, aye?

PS: not really mad, but if it sounds that way, hehe!! How bout we complian bout that LET one, who takes the time to type that ne way?

Code: Select all

LET a = b ' what??

a = b       ' hurra!!
then this might make since, :roll: :wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
Mitth'raw'nuruodo

Post by Mitth'raw'nuruodo »

Thanks Rattrapmax6 for your understanding,
I really don't like tar and feathers either.
Oh yeah I've heard of LET but I never heard of anyone
accually using it after that teletype thing, its just not needed
just like that RUN command :) .

-Mit
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

I do hope you are aware that I was joking right?

I dropped it, just thought it would be fun to post an example =)



Anyways, LET is really useful, I use it all the time.
You calling me a noob!? :lol:
I have left this dump.
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

:wink: I was aware, or mostly I was really hoping, lol,. :lol:

Your welcome Mit.. :)
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
Mitth'raw'nuruodo

Post by Mitth'raw'nuruodo »

i know Z!re, thanks

- mit
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

What!, You know nothing!

LET LET GOTO GOTO LET GOTO LET LET!
LET GOTO GOTO GOTO!
GOTO.
LET LET LET GOTO


And thats final!
I have left this dump.
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

:P Hay, this posts been moved to popular, lets finds some more statments to complian about! (Just joking, hehe!!) :wink: We got bout :shock: 500 to choose from, (rough guess).. :roll:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
Mitth'raw'nuruodo

Post by Mitth'raw'nuruodo »

Hey Rattrapmax6, I know you were joking but
how about that REM statement? :D
Half of my code is REM statements because
its nice to just read what a peice of code does,
and not have to spend extra long accually looking at it.
I know Z!re doesn't like to use this...
:idea: Oh yeah, while i'm on the topic
of bad coding and Z!re, ealier in this forum
he wrote a piece of code that shows that the GOTO
can save lines but there is a better way to write the non-GOTO
code, for example:
DO
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 EXIT DO
Next d
Next c
Next b
Next a
Print "ERROR"
EXIT DO
LOOP
End
See how simple that is Z!re.
Next thing you know is that he is going to comment
that he doesn't indent his code because
'he dont need no stinkin indents to make his eyes view the code better'
:lol:
Just Kidding
Ya know the combination of your Pic and comments scare me Z!re...
But to all ya Star Wars fans, my name is worste...Muhahahaha! :P

-Mit

P.S. What ever happened to that QB Chat Room, Its Dead for some
reason... :idea: ... :shock: ...
*Mit turns and looks at Z!re...
Z!re!!!...
Mitth'raw'nuruodo

Post by Mitth'raw'nuruodo »

One more thing I forgot...

The most useless command in QB is...*drum roll*... THE END STATEMENT!!!

Who uses that in there programs anyway, whats the point of it?

-Mit
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

Yeah, as for the chat thing, it kicks me out all the time.. I was going to set up a AOL 1, but I'm prob the only on able to use it besides a few QBers that use AOL,. oh well..

lol, :lol: , thats was right funny, Z!re, you don't comment, but you indent? good observation, Mit, you a detective or something? lol or just notice things?

PS: Say, Mit, you hang around alot, how come you don't register?..
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

:) Sorry, got a example on this END one, as follows: To insure solid termination of the program in diff locations of uses. sorta like this..

Code: Select all

DO
press$ = INKEY$
LOCATE 1, 1: PRINT "Press -Enter- to continue.."
LOCATE 2, 1: PRINT "Press -Esc- to exit.."
IF press$ = CHR$(27) THEN END
LOOP UNTIL press$ = CHR$(13)

DO
press$ = INKEY$
LOCATE 1, 1: PRINT "Press any key to continue.."
LOOP UNTIL press$ <> ""
Really breif example, oh well, lol, here we go again :wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
Mitth'raw'nuruodo

Post by Mitth'raw'nuruodo »

No, I'm not a detective, but I do notice things....

I'll probally register once I find a good pic of Mitth'raw'nuruodo
(Star Wars character, more commonally know as Grand Admiral Thrawn)
Or I'll make one myself.

He has a white uniform, black hair, red eyes, and blue skin: a chiss,
but no need to go into that now, just read the Grand Admiral Thrawn
trilogy written by Timothy Zahn.

-Mit

P.S. I was kidding about the END thing, I knew the benifits of it already. :D .
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

:wink: tg(on END statment), lol, hay, I might could find 1, all else, makesure it under 80x80 and I think 16MB, might b wrong.
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
Mitth'raw'nuruodo

Post by Mitth'raw'nuruodo »

Ok, thanks

But I think I can find one here somewhere...
*Mit searches through his room... :shock: ... I mean internet :D
I'll find one eventually

-Mit
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

16Mb!?

And ofcourse I indent, you must be crazy not to indent :D Oh.. wait...


And Mitt... lol at the DO/LOOP solution of it, neat, but one extra line of code.

And you're basically doing:

Code: Select all

Label_Do:
 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 Label_ExitDo
    Next d
   Next c
  Next b
 Next a
 Print "ERROR"
 Goto Label_ExitDo
Goto Label_Do
Label_ExitDo:
End 
Hehe, no gain, infact, it would be slower. Hehe... Yes, I win again! I'm so awesome :D




And I have nothing to do with the QBChat being empty... mmm tasty humanoids... flesh.... err.. I mean... err... have to go now!
I have left this dump.
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

Sorry, 16 KB, the M is under the K mind,.. lol
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
Mitth'raw'nuruodo

Post by Mitth'raw'nuruodo »

I'm dissapointed, I guess I'll have top settle for 16KB... :cry:

Z!re, thanks. But please leave the human race alone :lol: .

-Mit
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

No, I went back n looked, well the news gets worst, it really only 6Kb, 80x80.. Hay Z!re, 1 Q: how did you get that 150x150 smiley avatar on here? Just tried it without care, or you know something we don't?
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

I'm sneaky...


Offsite avatars can be larger...
I have left this dump.
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

K%l, wonder if it read it off mt FTP space?? Hmm, have to try it.. hehe!
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
Post Reply