|
Post by Technoid on Feb 18, 2002 17:17:39 GMT
I am new to qbasic 4.5. I have made a long input line and want to continue it to the next line. This is an example of what I am trying to do..
INPUT " Enter the size floor planks you will be using (4 for 2x4 or 6 for 2x6 ";planksize
Normaly the line would disapear off the page. Thats not a problem but in order for the printer to type out the line it has to appear on the viewed page. How do I bring the INPUT statement to the next line without qbasic highlighting to show an error in the run?
|
|
|
Post by fly@aol.com on Feb 19, 2002 2:02:10 GMT
well, here's how I would write it.
do print "enter floor plank size ('4' for 2x4, '6' for 2x6) " ; input planksize loop while planksize <> 4 and planksize <> 6
|
|
piegopher@hotmail.com
Guest
|
Post by piegopher@hotmail.com on Feb 19, 2002 6:16:53 GMT
I dont know whether I just really like the inkey command or if I really hate the input command, but I'd use this:
PRINT " Enter the size floor planks you will be using (4 for 2x4 or 6 for 2x6 " DO WHILE planksize$ = "" planksize$ = INKEY$ LOOP
of course this leaves you with a character instead of a number, so it could cause issues with other ideas like making sure the number picked was in a certain range or multiple digits or whatever... but for little things it works.
|
|
|
Post by Technoid on Feb 25, 2002 23:04:54 GMT
Thanks guys. It worked. I'll be back with a larger program problem. Off to School I go for more Qbasic education. ;D
|
|
|
Post by piegopher on Feb 26, 2002 1:42:24 GMT
You do Qbasic at SCHOOL?? *drool* take me with you...
|
|
brisray@yahoo.co.uk
Guest
|
Post by brisray@yahoo.co.uk on Feb 28, 2002 4:50:58 GMT
Oliver's idea of using INKEY$ is good, with inkey$ you can validate user input as it is being typed. I've been playing around with this idea for a while and you can see what I've come up with at members.lycos.co.uk/brisray/qbasic/qinput.htmRay
|
|
|
Post by Hendrix70 on Mar 17, 2002 17:58:26 GMT
You can do this:
PRINT "Enter the size floor planks you will be using" INPUT "(4 for 2x4 or 6 for 2x6)", planksize I don´t know if this help you, but the idea isn´t bad, no?
|
|