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..
Printable View
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..
would you mind attaching the whole source code file (*.txt if possible) and I will try my best to solve your problem
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!
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.
:)
Try this:
I hope this will help you a little further.Code:INPUT "Do you want to go further?"; answer$
IF answer$ = "Y" THEN ............
IF answer$ = "N" THEN ............
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!
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 :D
10x u just reminded me of the day of Qbasic :D 10x
thanks for the help, it was really bugging me {rimshot}