Posts: 5
Threads: 2
Joined: Jan 2004
Hi All.
Can someone please tell me know to make a small simple menu for my program?
All i am after is.
(1) - Test 1.
(2) - Test 2.
(3) - Test 3.
(X) - Exit.
Thanks For Your Time & Help.
Posts: 3,616
Threads: 287
Joined: Jan 2003
Since this is almost certainly for homework purposes, I won't give you the answer straight away, but I'll give you a few hints...
First you should start a loop, which will loop until you've pressed 1,2,3, or X
Then at the top, don't forget to clear the screen...and then print out the menu. Then use the INPUT statement and an IF statement to test what you've pressed. If 1, 2, or 3, or X, then the loop will exit, and the program will end.
Go try to put it all together, and make something - then, if you have any more problems, ask for help here.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 3,368
Threads: 195
Joined: Jan 2003
http://faq.qbasicnews.com/?blast=SelectItem
The FAQ link really should be more conspicuous..
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 5
Threads: 2
Joined: Jan 2004
Thanks for replying with that link.
But as i am a Newbie that has all gone over my head.
Posts: 3,616
Threads: 287
Joined: Jan 2003
Hmm...Let's see, two reasons why I didn't supply the FAQ link/direct code:
1) Because it's obviously homework
2) Because the dude asking is obviously new to QB, and don't you think that the FAQ (It should be called FUP - Frequently Uncommented Programs :roll
is a little confusing?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 5
Threads: 2
Joined: Jan 2004
below is the coding so far, without the menu.
Quote:CLS
PRINT "Epson Receipt Printer & Draw Kick Test Program v1.0"
PRINT "Copyright © 2004 Mad Professor"
CLS
LPRINT " Epson Receipt Printer "
LPRINT " & "
LPRINT " Draw Kick Test Program "
LPRINT " "
LPRINT " "
CLS
LPRINT " Should Of Opened Till Draw 1 "
LPRINT " (If Connected) "
LPRINT CHR$(27); CHR$(112); CHR$(0); CHR$(25); CHR$(250) 'Open's Till Draw No:1
LPRINT "----------------------------------------"
LPRINT " "
LPRINT " "
PRINT "Should Of Opened Till Draw 1"
CLS
LPRINT " Should Of Opened Till Draw 2 "
LPRINT " (If Connected) "
LPRINT CHR$(27); CHR$(112); CHR$(1); CHR$(25); CHR$(250) 'Open's Till Draw No:2
LPRINT "----------------------------------------"
LPRINT " "
LPRINT " "
LPRINT " "
LPRINT " "
LPRINT " "
LPRINT " "
PRINT "Should Of Opened Till Draw 2"
Posts: 3,616
Threads: 287
Joined: Jan 2003
Well...Alright.
Then add a loop...I'll give you a hint, DO WHILE menuOptionYouChoose <> "X"
Then put CLS at the top of the loop, and draw your menu...
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 3,368
Threads: 195
Joined: Jan 2003
Zack,
Quote: Hmm...Let's see, two reasons why I didn't supply the FAQ link/direct code:
1) Because it's obviously homework
2) Because the dude asking is obviously new to QB, and don't you think that the FAQ (It should be called FUP - Frequently Uncommented Programs :roll is a little confusing?
1) And...? The function, if you ever bothered to look at it, is completely modularized so that it can be adapted for any use.
2) No, I don't.
Mad Professor,
That code you put doesn't make any sense. Why is almost everything commented out? And why is "SHOULD HAVE" spelled as "Should of?"
All you need for the most simplest menu is to know how to use PRINT, INPUT, and variables.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 5
Threads: 2
Joined: Jan 2004
I can't spell to save my life and my gramer is crap.
I try my hardest to get by.
With Qbasic, the only command are know and know how to use are.
CLS, PRINT, LPRINT.
Al the other's i have not got a clue about.
Posts: 3,616
Threads: 287
Joined: Jan 2003
Then learn loops, IFs, and INPUT to make the menu.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.