DECLARE SUB VerticalMenu (boxstyle%, fc%, bc%, tr%, lc%, row%)
CLS
PRINT STRING$(2080, 219)

VerticalMenu 1, 15, 9, 7, 22, 8
'            ³  ³   ³   ³  ÀÄÄ¿ÀÄÄÄ¿
'  boxstyle%ÄÙ  fc% bc% ÀÄtr% lc%  row%
'          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
' Boxstyle:
' There are five choices of boxstyles (Press F 3 on the Tools Menu
' to see what they look like.)
'          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
' Fc%:
' Foreground color (Pick any color from 1 to 15)
'          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
' Bc%:
' Background color (Pick any color from 1 to 15)
'          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
' Tr%:
' Location of row for first line of box. (Placing longer menus below
' rows 12 to 16 will cause them not to properly appear on the screen.)
'          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
' Lc%:
' Location of first column for first line of box. (Menus are 25 columns
' wide, placing them near the edge of the screen at column 66 or greater
' will cause distortion.)
'          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
' Row%:
' Row% places the widebar menu selector on the first item of the menu
' (Row% is always one number larger than tr%)

SUB VerticalMenu (boxstyle%, fc%, bc%, tr%, lc%, row%)
DIM menu$(0 TO 11)
COLOR fc%, bc%
SELECT CASE boxstyle%
CASE 1
side$ = "³"
menu$(0) = "ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿"         'box building elements;
menu$(11) = "ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"        'all elements handled
CASE 2                                         'by menu$
side$ = "º"
menu$(0) = "ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"
menu$(11) = "ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼"
CASE 3
side$ = "º"
menu$(0) = "ÖÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ·"
menu$(11) = "ÓÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ½"
CASE 4
side$ = "³"
menu$(0) = "ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¸"
menu$(11) = "ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¾"
CASE 5
side$ = "Û"
menu$(0) = STRING$(25, 219)
menu$(11) = STRING$(25, 219)
END SELECT
menu$(1) = side$ + "     WASHINGTON        " + side$   'MenuMan has already
menu$(2) = side$ + "     LINCOLN           " + side$   'sized each entry to
menu$(3) = side$ + "     JEFFERSON         " + side$   'provide a full length
menu$(4) = side$ + "     ADAMS             " + side$   'widebar selector
menu$(5) = side$ + "     MONROE            " + side$
menu$(6) = side$ + "     KENNEDY           " + side$
menu$(7) = side$ + "     TRUMAN            " + side$
menu$(8) = side$ + "     JOHNSON           " + side$
menu$(9) = side$ + "     ROOSEVELT         " + side$
menu$(10) = side$ + "     EXIT PROGRAM      " + side$
FOR set = 0 TO 11
LOCATE set + tr%, lc%: COLOR fc%, bc%: PRINT menu$(set)
NEXT
row = row%   ' preset for widebar selector
DO
DO
SELECT CASE row
CASE row%: opt$ = "     WASHINGTON        "
CASE row% + 1: opt$ = "     LINCOLN           "  'sizing also preset for
CASE row% + 2: opt$ = "     JEFFERSON         "  'these entries which are
CASE row% + 3: opt$ = "     ADAMS             "  'needed to reprint entries
CASE row% + 4: opt$ = "     MONROE            "  'after widebar selector moves
CASE row% + 5: opt$ = "     KENNEDY           "  'on to next entry
CASE row% + 6: opt$ = "     TRUMAN            "
CASE row% + 7: opt$ = "     JOHNSON           "
CASE row% + 8: opt$ = "     ROOSEVELT         "
CASE row% + 9: opt$ = "     EXIT PROGRAM      "
END SELECT
LOCATE row, lc% + 1, 0: COLOR bc%, fc%: PRINT opt$
'prints first entry with widebar selector
keys$ = INKEY$
LOOP WHILE keys$ = ""
keymove = ASC(RIGHT$(keys$, 1))   'interprets scancodes
LOCATE row, lc% + 1, 0: COLOR fc%, bc%: PRINT opt$
'restores previous entry and color
SELECT CASE keymove
CASE 13
IF row = row% THEN END
IF row = row% + 1 THEN END  'this block of IF statements
IF row = row% + 2 THEN END  'will redirect the menu to perform
IF row = row% + 3 THEN END  'any user defined task within the
IF row = row% + 4 THEN END  'user's program
IF row = row% + 5 THEN END
IF row = row% + 6 THEN END  'Edit out "END"
IF row = row% + 7 THEN END
IF row = row% + 8 THEN END
IF row = row% + 9 THEN END
CASE 72: row = row - 1  'moves widebar selector down 1 row
CASE 80: row = row + 1  'moves widebar selector up 1 row
CASE 71: row = row% + 9 'shortcut keys
CASE 79: row = row% + 9 'shortcut keys
END SELECT
IF row < row% THEN row = row% + 9 ELSE IF row > row% + 9 THEN row = row%
'sets limits for widebar selector
LOOP
END
END SUB

