Posts: 3,343
Threads: 83
Joined: Mar 2003
1) Go into your QB IDE
2) Type "DO"
3) Press return
4) Press "up" once
5) Press "F1"
6) Repeat for IF and INKEY$
That should help ya
Posts: 1,845
Threads: 44
Joined: Aug 2002
Hehe :lol: Reminds me of such a strange tutorial about how to use windows programs...
1) Click on the icon of the program you want to start. An icon is ................. you see on the left corner of the screen,.... no not that one. .... blablabla.
2) After you clicked, click again really fast so that you 'double-click'...
omg, I don't even want to complete it
Posts: 594
Threads: 11
Joined: Oct 2002
Quote:Hehe :lol: Reminds me of such a strange tutorial about how to use windows programs...
1) Click on the icon of the program you want to start. An icon is ................. you see on the left corner of the screen,.... no not that one. .... blablabla.
2) After you clicked, click again really fast so that you 'double-click'...
Wow...I've never seen such a great tutorial....ADD IT TO THE FAQ,...,C'MON
:rotfl:
B 4 EVER
Posts: 480
Threads: 24
Joined: Mar 2003
1. Display the options on the screen
2. start a loop
3. get a letter from the keyboard, and save it into a string variable
4. if the string variable doesn't equal one of the options, keep looping
Hope that helps. I recommend looking up PRINT for displaying the options, DO and WHILE for the loop, and INPUT and INKEY$ for the letter input, and IF and INSTRING for the test of variable vs. options.
Good luck!
*peace*
Meg.
p.s. Zack, your running guy icon is really funny.
Posts: 719
Threads: 72
Joined: Mar 2003
I got sum code for u....
Code:
screen 0
do
locate 1,1:print "1. Opt1"
locate 2,1:print "2. Opt2"
locate 3,1:print "3. Opt3"
locate 4,1:print "4. Exit"
do
a$ = inkey$
if a$ = "1" then
locate 5,1:print "Action:Option1"
elseif a$ = "2" then
locate 5,1:print "Action:Option2"
elseif a$ = "3" then
locate 5,1:print "Action:Option3"
elseif a$ = "4" then
locate 5,1:print "Action:Exit"
end
end if
loop
or, if you want something more visually appealing:
Code:
screen 0
dim menu(1 to 4) as string
menu(1) = "Option 1"
menu(2) = "Option 2"
menu(3) = "Option 3"
menu(4) = "Exit"
opt = 1
do
a$ = inkey$
select case right$(a$,1)
case "H" 'code for key up
opt = opt - 1
if opt<1 then opt = 4
case "P" 'code for key down
opt = opt+1
if opt>4 then opt = 1
end select
for show = 1 to 4
if opt = show
color 15,1
else
color 15,0
end if
locate show,1:print menu(show)
next
if a$ = chr$(13) then 'enter key
if opt<4 then
locate 5,1:print "Action:Option"+opt
else
locate 5,1:print "Action:Exit"
end
end if
loop
And that is it.....e-mail me if you need an explaination
Posts: 3,616
Threads: 287
Joined: Jan 2003
Quote:p.s. Zack, your running guy icon is really funny.
The Wolfenstein 3D dude - BJ Blazkowicz.
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
Oh yeah? Wel I used currentChoice so nyah!
*stab*
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.