Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HELP AGAIN
#11
*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"
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#12
Quote: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. Smile

EDIT:
toonski84 said it better. Also people... SAVE THE KITTENS
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#13
Good! Now answer the file open one! I bet you can copy and paste at least 2 from the past half-week...
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
#14
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)
url=http://www.spreadfirefox.com/?q=affiliates&id=60131&t=79][Image: safer.gif][/url]
END OF LINE.
Reply
#15
I don't do RTFM often..
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
#16
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
Reply
#17
.......

Quote:In the QB main screen, Press ALT+C. Press H. Click on the DATA TYPES link. Click on the STRINGS list.
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
#18
Quote:Did u just say that coz u dont know wot 2 do urself!!!??

Yep. None of us know how to program. Smile
earn.
Reply
#19
Quote: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!
earn.
Reply
#20
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/
earn.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)