DECLARE SUB Browse(FileName$,Mouse%,TextColor%,TopRow%,LeftColumn%,BottomRow%,RightColumn%,Attr%,Shadow%,Border%)
DECLARE SUB PopWind(Title$,TopRow%,LeftColumn%,BottomRow%,RightColumn%,Attr%,Shadow%,Border%)
DECLARE SUB SaveScreen(ScreenID$,TopRow%,LeftColumn%,BottomRow%,RightColumn%,Shadow%)
DECLARE SUB SplitPath(FilePath$, Path$, FileName$)
DECLARE SUB RestoreScreen(ScreenID$,TopRow%,LeftColumn%)
DECLARE SUB CalcByte(Attr%,LowByte%,HiByte%)
DECLARE SUB Clicked(Rgt%,Lft%,Row%,Col%)
DECLARE SUB FindMenu(Row%,Col%,Found%)
DECLARE SUB HideCursor()
DECLARE SUB ShowCursor()
DECLARE FUNCTION LeftButtonReleased%()
DECLARE FUNCTION GetProgramName$()
DECLARE FUNCTION GetPSP%()
SUB VerticalMenu(Choices$(),Infoline$(),Rtrn$,BarSave$,Mouse%,HotKey%,HelpTextColor%,HelpAttr%,HiAttr%,MenuRow%,Marker%,HPointer%,Attr%,Shadow%,Border%) PUBLIC
$CODE SEG "DNASEG2"
IF Mouse% THEN HideCursor
CalcByte Attr%,FGround%,BGround%
CalcByte HiAttr%,HiFG%,HiBG%
SplitPath GetProgramName$,Home$,EXEName$
SELECT CASE Border%
CASE 1,3
Leftside% = 195
Middle% = 196
Rightside% = 180
CASE 2,4
Leftside% = 199
Middle% = 196
Rightside% = 182
CASE ELSE
Leftside% = 32
Middle% = 32
Rightside% = 32
END SELECT
i% = 0 'loop counter
j% = 0 'loop compare
Maxlength% = 0 'string length counter
Colpos% = Marker%
LeftColumn% = Colpos%
TopRow% = MenuRow% + 1
DO
INCR i%
INCR j% 'first find out how many
'strings there are and the
IF LEN (Choices$(i%)) = 0 THEN 'length of the longest one
DECR i%
ELSEIF LEN(REMOVE$(Choices$(i%),"@")) > Maxlength% THEN
Maxlength% = LEN(REMOVE$(Choices$(i%),"@"))
END IF
LOOP WHILE i% = j%
Count% = i%
INCR Maxlength% 'add a space
'a simple test to see what size the window will be with the shadow
IF Shadow% = 1 THEN
b% = 5
ELSE
b% = 3
END IF
'test the position of the menu to see if it fits and adjust
'its position if its off the screen
IF LeftColumn% + (Maxlength% + b%) >= 80 THEN
LeftColumn% = 80 - (Maxlength% + b%)
END IF
'work out the size of the window to pass to PopWind
RightColumn% = LeftColumn% + (Maxlength% + 2)
BottomRow% = TopRow% + (Count% + 1)
'this saves just the area under the pulled down window