AllExperts > Qbasic, Quickbasic 
Search      
Qbasic, Quickbasic
Volunteer
Answers to thousands of questions
 Home · More Qbasic, Quickbasic Questions · Answer Library  · Encyclopedia ·
More Qbasic, Quickbasic Answers
Question Library

Ask a question about Qbasic, Quickbasic
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Alex Barry
Expertise
I have been a qbasic programmer since 2000, creating games, minor libraries and various small programs. I have experience using interrupts, graphics, file input/output, the mouse cursor, and using libraries. I have also learned FreeBASIC, c/c++, python, php and html.
I do not claim to be an absolute authority in any language, but I don't mind looking things up and learning with you.

Experience
Hobby programming since 2000

I no longer belong to any community programming groups, but do have knowledge of *basic dialects and C/C++

 
   

You are here:  Experts > Computing/Technology > Basic > Qbasic, Quickbasic > What is text1.text in qbasic

Qbasic, Quickbasic - What is text1.text in qbasic


Expert: Alex Barry - 6/24/2009

Question
I'm taking classes for a 9th grade student from a different school. She's got the following code for accepting user entry from her teacher at school. But i'm not aware of anything of the sort in qbasic. Pl. help !

a=val(text1.text)
if a mod 2=0 then
print "The number entered is an even number"
else
print "The number entered is an odd number"
endif


why are they using text1.text and not INPUT to acept a number from the user ?? More importantly, is text1.text allowed in Qbasic ???
Please Help !

Answer
Hi, Smitha,
text1.text is definately a variable, but just how it is written, it looks like it is more likely from Visual Basic, opposed to QBasic.

Either way, you could change that to this:

DIM text AS STRING
DIM a AS INTEGER
INPUT "Number: ", text
a = VAL( text )
IF ( a MOD 2 ) = 0 THEN
 PRINT "The number entered is an even number"
ELSE
 PRINT "The number entered is an odd number"
END IF

I hope that answers your question.  Again, you may want to look into the class to see if it is teaching QBasic or Visual BASIC

Take care,
-Alex

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.