|
-
October 10th, 2003, 09:24 PM
#1
Type Mismatch in Qbasic
I am writing a program in Qbasic, and whenever i try to run it i get a "Type mismatch" error.
the line that it says the error is on is like
if yesno$=Y then
if you need more, just ask. Thanks in advance..
\"Look, Doc, I spent last Tuesday watching fibers on my carpet. And the whole time I was watching my carpet, I was worrying that I, I might vomit. And the whole time, I was thinking, \"I\'m a grown man. I should know what goes on my head.\" And the more I thought about it... the more I realized that I should just blow my brains out and end it all. But then I thought, well, if I thought more about blowing my brains out... I start worrying about what that was going to do to my goddamn carpet. Okay, so, ah-he, that was a GOOD day, Doc. And, and I just want you to give me some pills and let me get on with my life. \" -Roy Waller
-
October 10th, 2003, 09:30 PM
#2
Member
would you mind attaching the whole source code file (*.txt if possible) and I will try my best to solve your problem
-
October 10th, 2003, 10:00 PM
#3
ah, good ol' "Type Mismatch" Error Code 13 I believe 
Try making sure that you're not trying to pass a string to integer, or integer to string, etc... This error happens when you try to pass a value into a variable of the wrong type...
Check your variable defenitions!
yeah, I\'m gonna need that by friday...

-
October 13th, 2003, 10:34 AM
#4
Member
This has to do with conflicting datatypes (for example store a numeric input in a character variable).
This is something simple that many programmers face.
The FACT that people ignore FACTS
doesnt mean that FACTS are not FACTS 
-
October 13th, 2003, 10:48 AM
#5
Try this:
Code:
INPUT "Do you want to go further?"; answer$
IF answer$ = "Y" THEN ............
IF answer$ = "N" THEN ............
I hope this will help you a little further.
-
October 13th, 2003, 11:45 AM
#6
Senior Member
I believe the problem is here, judging from the code you posted, that you forgot the "Y". You always have to do that when defining a string variable, or in your case a variable that is looking for a text input (a string). Just add the quotation marks at the beginning and end of the Y
ex.
if yesno$ = "Y" then
Hope that helps!
Creating further mindless stupidity....through mindless automation.
-
October 13th, 2003, 01:58 PM
#7
Senior Member
this is Qbasic... u must have " " aroud all non numerical charecters........ as this is a "Y" u must have it in " "
if yesno$="Y" then <===this is the correct line I think 
10x u just reminded me of the day of Qbasic 10x
-
October 14th, 2003, 08:41 PM
#8
thanks for the help, it was really bugging me {rimshot}
\"Look, Doc, I spent last Tuesday watching fibers on my carpet. And the whole time I was watching my carpet, I was worrying that I, I might vomit. And the whole time, I was thinking, \"I\'m a grown man. I should know what goes on my head.\" And the more I thought about it... the more I realized that I should just blow my brains out and end it all. But then I thought, well, if I thought more about blowing my brains out... I start worrying about what that was going to do to my goddamn carpet. Okay, so, ah-he, that was a GOOD day, Doc. And, and I just want you to give me some pills and let me get on with my life. \" -Roy Waller
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|