Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Menu
#1
How do i make an menu like this:

0=cursor

0 New
Load
Exit
then if you press down the cursor will move to load e.t.c.
i have tried but i cant do it Sad
Reply
#2
i made this awhile ago. it seems to work. i put comments in. ask if you have a question
Code:
DECLARE SUB menu (data$, numofitems, mode, detail$, sw, sh)
CALL menu("Menu1Menu2...  Close", 4, 1, "My menu", 80, 24)

SUB menu (data$, numofitems, mode, detail$, sw, sh)
CLS
ub = numofitems
lb = 1
selected = 1
COLOR 15
LOCATE sh / 2 - ub / 2 - lb + 1 - 1, (sw / 2) - (LEN(detail$) / 2)
PRINT detail$
DO
FOR i = lb TO ub
word$ = CHR$(219) + LTRIM$(STR$(i)) + ") " + MID$(data$, (i - 1) * (LEN(data$) / ub) + 1, LEN(data$) / ub) + " " + CHR$(219)
LOCATE sh / 2 - INT(ub / 2 + .5) + i, (sw / 2) - (LEN(word$) / 2)

'Change the select color here
IF selected = i THEN COLOR 4 ELSE COLOR 15
PRINT word$
NEXT
press$ = INKEY$
SELECT CASE press$
CASE CHR$(0) + CHR$(72): selected = selected - 1
CASE CHR$(0) + CHR$(80): selected = selected + 1
CASE CHR$(13)
'\/\/\/\/Multiple modes for multiple menus
SELECT CASE mode
CASE 1:
'\/\/\/\/Here you change what each links do (like call a sub)
SELECT CASE selected
CASE 1: COLOR 15:
CASE 2: COLOR 15:
CASE 3: COLOR 15:
CASE 4: COLOR 15: END
END SELECT
'
END SELECT
END SELECT
IF selected < lb THEN selected = ub
IF selected > ub THEN selected = lb
LOOP
END SUB

(BTW: oracle if you are there if you put this in the syntax highlighterthing it messes it up)
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#3
ok thanks Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)