Qbasicnews.com

QBasic => QB Discussion & Programming Help => Topic started by: tomlewis86 on June 04, 2003, 02:45:15 PM



Title: HELP AGAIN
Post by: tomlewis86 on June 04, 2003, 02:45:15 PM
I'm making a program where you can select different people to be on you team in a quiz. When you choose a person i want to make that name visible in a team member screen. The code i thought of using was:

team.member = bob
PRINT team.member

All i get when i run this is the number 0!

Any suggestions?!

Tom. :o


Title: HELP AGAIN
Post by: Agamemnus on June 04, 2003, 02:49:38 PM
R T F M


Title: HELP AGAIN
Post by: Ninkazu on June 04, 2003, 02:54:59 PM
Quote from: "Agamemnus"
R T F M


4 teh n00bs aote tare, tis menz red teh fckign manuel.


Title: W F M!!
Post by: tomlewis86 on June 04, 2003, 03:08:33 PM
WOT FUCKIN MANUAL!!

Did u just say that coz u dont know wot 2 do urself!!!??


Title: HELP AGAIN
Post by: Ninkazu on June 04, 2003, 03:13:19 PM
dude, you have to but quotes around a string, so this is what you have to do:

DIM team.member AS STRING
team.member = "bob"
PRINT team.member

n00b.


Title: Thanks but help again
Post by: tomlewis86 on June 04, 2003, 03:18:02 PM
i tried wot u sed but the message 'Type mismatch' came up!

Wot's wrong?

Tom.


Title: HELP AGAIN
Post by: Ninkazu on June 04, 2003, 03:18:33 PM
Quote from: "wizardlife"
They're copulating on my desk...


I hope you know "copulating" means to have sex in teh vagina.


Title: HELP AGAIN
Post by: tomlewis86 on June 04, 2003, 03:19:41 PM
could u stop talkin bout copulating please n help me?


Title: HELP AGAIN
Post by: Agamemnus on June 04, 2003, 03:28:30 PM
In the QB main screen, Press ALT+C. Press H. Click on the DATA TYPES link. Click on the STRINGS list.


Title: HELP AGAIN
Post by: prof_flex on June 04, 2003, 04:02:16 PM
team.member$ = "bob"
PRINT team.member$


Title: HELP AGAIN
Post by: toonski84 on June 04, 2003, 04:31:19 PM
*sigh* the man asked a valid question.  Every time you yell "RTFM" at someone instead of answering their question, God kills a kitten.

There are different types of variables (a label representing a value) in qbasic:  Numeric (integer, long integer, single pres., double pres.), and string (fixed and regular).

you can't mix and match strings and numeric values, qb assumes all varaibles (in this case, team.member) to be single precision numbers.  So you have to specify that team.member is a string, either:

1) by referring to it as team.member$ (variables ending in $ are strings)
2) DIMing it as a string:
   
Code:
DIM team.member as string


afterwords, any string value must but in quotation marks, otherwise qb assumes it to be another variable (in this case, bob).

   
Code:

DIM team.member as string
team.member = "Bob"    
   


Title: Re: HELP AGAIN
Post by: whitetiger0990 on June 04, 2003, 04:32:31 PM
Quote from: "tomlewis86"
I'm making a program where you can select different people to be on you team in a quiz. When you choose a person i want to make that name visible in a team member screen. The code i thought of using was:

team.member = bob
PRINT team.member

All i get when i run this is the number 0!

Any suggestions?!

Tom. :o


bob isn't in quotes. so it is saying that team.member = the value a bob. Bob doesn't equal anything so it print 0.

Also
it should read

team.member$ = "bob"
PRINT team.member$

The variable team.member becomes a string when you out a $ on it. Then it says that it equals "bob".

if you put
team.member$ = bob
PRINT team.member$

YOu get a type mismatch because a string can't equal a non-string. If youy aren't confused by now. YOu should understand.  :)

EDIT:
toonski84 said it better. Also people... SAVE THE KITTENS


Title: HELP AGAIN
Post by: Agamemnus on June 04, 2003, 05:15:36 PM
Good! Now answer the file open one! I bet you can copy and paste at least 2 from the past half-week...


Title: HELP AGAIN
Post by: Phydaux on June 04, 2003, 11:16:42 PM
I don't mean to be anal here but this is the newbie help forum, where n00bs ask for help. It really doesn't help them by calling them n00bs, and telling them to RTFM when they are in a n00b forum. If you can't handle these questions (even if they pop up time-and-time again) don't look in the newbie help forum.

"He who asks a question is a fool for an hour, he who doesn't ask a question is a fool for ever" -Chinese proverb (probably paraphrased)


Title: HELP AGAIN
Post by: Agamemnus on June 04, 2003, 11:42:59 PM
I don't do RTFM often..


Title: HELP AGAIN
Post by: oracle on June 05, 2003, 07:44:15 PM
Guys... This was the perfect chance to throw a link to the FAQ, or the correct QBOHO page, and you blew it!!!  :wink:

Wasn't this sort of question what the FAQ was for??? So toonski didn't have to write out all that stuff?

This thread should have gone like this:

tomlewis86: help (abridged)
agamemnus: http://faq.qbasicnews.com/answer
tomlewis86: thanks


Title: HELP AGAIN
Post by: Agamemnus on June 05, 2003, 07:46:57 PM
.......

Quote from: "Agamemnus"

In the QB main screen, Press ALT+C. Press H. Click on the DATA TYPES link. Click on the STRINGS list.


Title: Re: W F M!!
Post by: seph on June 05, 2003, 07:49:15 PM
Quote from: "tomlewis86"
Did u just say that coz u dont know wot 2 do urself!!!??


Yep. None of us know how to program. :)


Title: HELP AGAIN
Post by: seph on June 05, 2003, 07:51:27 PM
Quote from: "tomlewis86"
could u stop talkin bout copulating please n help me?


Man, don't you just LOOOOVE copulating? It's soooo fun!

What do you guys think? Should we be extremely sarcastic or mean to this guy? I mean, he has the balls to come in here, not knowing a damn thing about programming, and ask why his program isn't working. I mean, he reminds me of the young, stupid me!


Title: HELP AGAIN
Post by: seph on June 05, 2003, 07:55:00 PM
Also, I don't ever read the manual. Why? Well, I don't know where the manual is. Actually, I only heard about it from RTFM.
Is this it? http://qbasicnews.com/qboho/


Title: HELP AGAIN
Post by: Agamemnus on June 05, 2003, 10:02:02 PM
well everyone knows that rtfm means look at the blatantly obvious qb help...


Title: HELP AGAIN
Post by: seph on June 05, 2003, 10:03:24 PM
Oh. Yeah, I did that quite a few hundred times when I was like 10.


Title: HELP AGAIN
Post by: oracle on June 05, 2003, 10:09:56 PM
Seph: ever heard of the "edit" button up in the top-right corner of your posts. Double posting shouldn't be done unless you need to revive an old topic and you were last poster.


Title: HELP AGAIN
Post by: na_th_an on June 06, 2003, 10:05:45 AM
Quote from: "toonski84"
*sigh* the man asked a valid question.  Every time you yell "RTFM" at someone instead of answering their question, God kills a kitten.

There are different types of variables (a label representing a value) in qbasic:  Numeric (integer, long integer, single pres., double pres.), and string (fixed and regular).

you can't mix and match strings and numeric values, qb assumes all varaibles (in this case, team.member) to be single precision numbers.  So you have to specify that team.member is a string, either:

1) by referring to it as team.member$ (variables ending in $ are strings)
2) DIMing it as a string:
   
Code:
DIM team.member as string


afterwords, any string value must but in quotation marks, otherwise qb assumes it to be another variable (in this case, bob).

   
Code:

DIM team.member as string
team.member = "Bob"    
   


... has been added to the FAQ.


Title: HELP AGAIN
Post by: Neo on June 06, 2003, 10:11:27 AM
He forgot about the:

DEFFN command

Code:
DEFINT A-Z : All unexplicitly declared variables from now are integer
DEFLNG A-Z : All unexplicitly declared variables from now are long
DEFSNG A-Z : All unexplicitly declared variables from now are single
DEFDBL A-Z : All unexplicitly declared variables from now are double
DEFSTR A-Z : All unexplicitly declared variables from now are string

Of course you can do also other character instead of the A or Z, but beware that each variable not starting with the letter in range is something else than you defined.


Title: What utter nonsense! The best...
Post by: Glenn on June 06, 2003, 10:27:22 AM
help you can give anyone beginning *anything* is to point them to sources of information and encourage them to use such sources, so they can *learn for themselves* (and thus become a non-beginner), especially when that information is right at their fingertips.


Quote from: "Phydaux"
I don't mean to be anal here but this is the newbie help forum, where n00bs ask for help. It really doesn't help them by calling them n00bs, and telling them to RTFM when they are in a n00b forum. If you can't handle these questions (even if they pop up time-and-time again) don't look in the newbie help forum.

"He who asks a question is a fool for an hour, he who doesn't ask a question is a fool for ever" -Chinese proverb (probably paraphrased)


Title: HELP AGAIN
Post by: Neo on June 06, 2003, 10:31:23 AM
Here's QBOHO, FAQ, QB Help itself, ..., internet, ... there is so much to learn from

But why, ..., why don't they read that stuff?


Title: HELP AGAIN
Post by: oracle on June 06, 2003, 07:58:24 PM
Because newbies don't know that QBOHO and the WIKIFAQ exist, cos there is no publicity for it. There needs to be links to the FAQ and QBOHO explicitly displayed on the home page of QBnews, like in the place where the "Another World Memory Game" is, that's been there for ages.


Title: HELP AGAIN
Post by: Hexadecimal Disaster on June 06, 2003, 11:36:29 PM
er... If you take into consideration that QBOHO is a web-rendition of the QB Help File, that can be easily accessed in the IDE by pressing F1, the problem isn't the "lack of publicity" of the help/knowledge systems of this website. The problem is something far more scary than that.


Title: HELP AGAIN
Post by: oracle on June 06, 2003, 11:45:57 PM
But still the WIKI...


Title: HELP AGAIN
Post by: Hexadecimal Disaster on June 07, 2003, 02:58:40 AM
Maybe. Anyways, still the main source of info is so near of you... so near... so near... *sighs*


Title: HELP AGAIN
Post by: relsoft on June 07, 2003, 03:00:34 AM
would somebody explain to me what WIKI means?

Hex, toonski, Nathan...????


Title: HELP AGAIN
Post by: seph on June 07, 2003, 03:03:49 AM
It's Kiwi's evil twin, if I'm not mistaken.


Title: HELP AGAIN
Post by: Hexadecimal Disaster on June 07, 2003, 03:23:20 AM
Heh, yeah.

Rel, refer to http://forum.qbasicnews.com/viewtopic.php?t=1049&start=20. And, as always, in doubt... ask Google!  :P


Title: HELP AGAIN
Post by: oracle on June 08, 2003, 05:38:13 PM
I wish you were so nice to me when you explain stuff Hex...  :P


Title: HELP AGAIN
Post by: Hexadecimal Disaster on June 08, 2003, 11:24:25 PM
(http://www.handykult.de/plaudersmilies.de/eek7.gif)

Awww, duuuuuuude...


Title: HELP AGAIN
Post by: relsoft on June 09, 2003, 12:51:25 AM
Quote from: "seph"
It's Kiwi's evil twin, if I'm not mistaken.


But then again.. what is a KIWI?  The only KIWI I know is from New Zealand. ;*)