I am a beginner and need some help.<br>
I am trying to have an input var$ that they didn't enter anything for to tell them thsy must enter something.<br>
This how i have it but it doesn't work:<br>
IF mail.nam = "" THEN GOTO 2410 <br>
Can you help?????<br>
Paul
If you use the Var mail.nam then you shouldn´t use "" cause you<br>
are using an Integer with an String where "" is you string<br>
better use 0 (zero)<br>
Doc DooM
I think DocDoom is right, try testing for 0 instead of null.<br>
Pan1, why are you using line numbers? The fact that QBasic allows alpha labels makes the language more usable than the original BASIC.<br>
<br>
MIght try this...I'm not *proficient* with QB though...so I might have a few syntax problems...will try to error-shoot this one b4 clicking submit:<br>
<br>
DIM xxx as STRING<br>
xxx = ""<br>
DO while xxx = ""<br>
input "question",xxx<br>
LOOP<br>
<br>
<br>
This *SHOULD* keep prompting the user with "question" indefinately until they give you an answer. GOOD LUCK!<br>
<br>
<br>
-Robherc
You might want to try this one to.<br><br>1:<br>CLS<br>LOCATE 13,30<br>INPUT "*question*",mail.nam$<br>IF mail.nam$ = "" THEN GOTO 1
(Programmer) Apr 8, 2000<br>hey! that will put pan1 in a never-ending loop. Not fair, kreep!<br><br>Only until mail.nam$ has a non-null value . . . ??
It'll send it to 1: only if nothing is added you can also add this if you want the "user" to know why it's asking again:<br><br>1:<br>CLS<br>LOCATE 13,30<br>INPUT "*question*",mail.nam$<br>IF mail.nam$ = "" THEN <br>DO<br>PRINT "Please answer the Question"<br>LOOP WHILE INKEY$ <> ""<br>END IF<br>GOTO 1<br>
kreep (Apr 15, 2000)<br><br>That code will definitely make his head spin--in an infinate loop that is. Think you should move the "GOTO 1" line up one (1) line so that it is executed in the IF..THEN statement.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.