Another tool which all toolboxes should have, in some form or another -- an easy to use routine to display a large list on the screen.
DIM Array(10) AS STRING
DATA Apple,Banana,Cherry,Date,Fig,Grape,Huckleberry,Iced Fruit,Jambolan,Kiwi,Lemon
FOR i = 0 TO 10
READ Array(i)
NEXT
choice = 0
DO
CLS
DisplayList 10, 10, 20, 5, choice, Array(), -1
k = _KEYHIT
SELECT CASE k
CASE 18432
choice = choice - 1
IF choice < 0 THEN choice = 0
CASE 20480
choice = choice + 1
IF choice > 10 THEN choice = 10
END SELECT
_DISPLAY
_LIMIT 30
LOOP
SUB DisplayList (x AS INTEGER, y AS INTEGER, w AS INTEGER, l AS INTEGER, s AS INTEGER, choices() AS STRING, numbered AS _BYTE)
'x/y location to place the start of our list
'w is the width of our list on the screen
'l is the length of the list items we want to display at a time
's is the starting element that we want to display on the screen
'choices() is the array that holds the actual list for us
'numbered is the toggle for if we want to autonumber our list or not.
' 0 says we don't want to number the list; just display it.
' A value less than 0 says we want to display the number index of the visible list
' A value greater than 0 says we want to display the number of visible elements from the list on the screen.
'Some basic error checking is in need here
IF s < LBOUND(choices) THEN s = LBOUND(choices)
IF s + l - 1 > UBOUND(choices) THEN l = UBOUND(choices) - s + 1
LOCATE x
start = s: finish = s + l - 1
FOR i = start TO finish
counter = counter + 1
IF numbered > 0 THEN counter$ = LTRIM$(STR$(counter)) + ") "
IF numbered < 0 THEN counter$ = LTRIM$(STR$(counter + start - 1)) + ") "
LOCATE , y: PRINT counter$ + LEFT$(choices(i), w - LEN(counter$))
NEXT
END SUB
This is about as simple as it gets, with the actual code here in the sub being smaller than the comments to explain the sub... Works in all screen modes, with use of simple LOCATE coordinates for placement. ;)