Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how do u display text
#1
how do u display text
Reply
#2
Hi RYAN... just so you know... it's not a good idea to use words like u instead of you. It just looks so un professional...

To display text in QB. Inside the program, you type PRINT "<text here>" So if you want to display. "I eat dogs", you would type.

Code:
PRINT "I eat dogs"

Whatever you want displayed goes in quotations. If you leave out quotations, what you type will be counted as variables... which you'll learn about soon.

http://www.qbasic.com/frames.shtml
Go here... you will learn the basics of Qbasic and someday, become a qbasic master like me...
Reply
#3
Ok, since you asked in Messenger, I'll just tell you here...

A Variable is just a value. Example:

Apples = 50
Oranges = 54
Cheeses = 50
Dogs = 34

In the first one, Apples would be the variable and 50 would be the value. Variables are like, the most important thing in programming.
So in QBasic, if you wanted A to be 50 , then it would be as simple as...

Code:
A = 50

And tadah, A is equal to 50. You can make 50 into a different number if you want.

You can use A in place of other numbers.

(By the way, using the PRINT command. If you want it to put the value of a variable, put the variable OUT of the parenthesis, so it would look like.

Code:
Apples = 849
PRINT "PJ Haye has " ;Apples " dollars."

If you noticed, I said dollars, even though the variable was apples, what the variable *says* doesn't matter, but it makes it easier to know what you're talking about.)

I actually gave an example up there. Let me break it apart.

Code:
Apples = 849
This is saying that the Value of Apples is equal to 849. This can be changes to whatever you want. If you want the value to be text, you must add a dollar sign to the end of the variable

Code:
PRINT "PJ Haye has" ;Apples " dollars."

This will make it say "PJ Haye has 849 dollars." It does this because I use the PRINT command to display the text. Whatever is in the quotations is what it says no matter what, whatever is out, will make it show the value. So if apples was inside the quotations, then it would say, "PJ Haye has ;Apples dollars.", and that's just plain weird. Also, before a variable in a print command, you put a semicolon ; . If you forget to add it, QB should add it automatically.

I hope this helped you. I know it did.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)