Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with menu in QBasic
#1
i'd like to create a "hot key" menu in QB, i've tryed, but I could not figure how to do it.....could someone plz tell me how to do it?
color=darkred]Imperishable flames are mine to controll![/color]
Reply
#2
i've tryed some more.....found one possible way.....it has one great issue thougth, it doesen't seem to respond at my first click, i have to click many times...

CLS
PRINT "please select one of the numbers"
PRINT "1...right"
PRINT "2...this works"
PRINT "3...yahoo"

DO
IF INKEY$ = CHR$(49) THEN GOTO blah
IF INKEY$ = CHR$(50) THEN GOTO blah1
IF INKEY$ = CHR$(51) THEN GOTO blah2
LOOP


blah:
CLS
PRINT "right!"
END

blah1:
CLS
PRINT "this works!"
END

blah2:
CLS
PRINT "YAHOO!"
END

anyone got a better way?
color=darkred]Imperishable flames are mine to controll![/color]
Reply
#3
Code:
Dim ky As String

Cls

Print "please select one of the numbers"
Print "1...right"
Print "2...this works"
Print "3...yahoo"

Do
  ky = Inkey$

  If ky = Chr$(49) Then Goto blah
  If ky = Chr$(50) Then Goto blah1
  If ky = Chr$(51) Then Goto blah2

Loop


blah:
Cls
Print "right!"
End

blah1:
Cls
Print "this works!"
End

blah2:
Cls
Print "YAHOO!"
End
Reply
#4
it works, thanks alot mate Big Grin
color=darkred]Imperishable flames are mine to controll![/color]
Reply
#5
anytime
Reply
#6
Nice work, cha0s...
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.
Reply
#7
now a new problem came up, from the menu I start a Game, it uses SCREEN 13, when the game exits, i've set it to go back to the menu...in the menu I have COLOR 5, 0.....it says "illigeal function call" what is wrong?
color=darkred]Imperishable flames are mine to controll![/color]
Reply
#8
You can't set a background colour in mode 13h. Just go back to text mode with

Code:
SCREEN 0: WIDTH 80,25

before attempting to change colour/print/anything.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#9
thx Wink
color=darkred]Imperishable flames are mine to controll![/color]
Reply
#10
I am scared.
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)