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 RestoreScreen(ScreenID$,TopRow%,LeftColumn%)
DECLARE SUB CalcByte(Attr%,LowByte%,HiByte%)
DECLARE SUB Clicked(Rgt%,Lft%,Row%,Col%)
DECLARE SUB HideCursor()
DECLARE SUB ShowCursor()
DECLARE SUB LocateCursor(Row%,Col%)
DECLARE SUB SplitPath(FilePath$, Path$, FileName$)
DECLARE FUNCTION GetProgramName$()
DECLARE FUNCTION GetPSP%()
DECLARE FUNCTION LeftButtonReleased%()
DECLARE FUNCTION RightButtonReleased%()
DECLARE FUNCTION TRIML$(Strng$,Amount%)
SUB ScrollMenu(Choices$(),Infoline$(),Rtrn$,Mouse%,Winsize%,Tag%,Centre%,HotKey%,HelpTextColor%,HelpAttr%,HiAttr%,Attr%,TopRow%,LeftColumn%,Shadow%,Border%) PUBLIC
$CODE SEG "DNASEG2"
CalcByte Attr%,FGround%,BGround%
CalcByte HiAttr%,HiFG%,HiBG%
SplitPath GetProgramName$,Home$,EXEName$
i% = 0 'loop counter
j% = 0 'loop compare
Maxlength% = 0 'string length counter
IF Mouse% THEN HideCursor
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%
ELSE
IF LEN(REMOVE$(Choices$(i%),"@")) > Maxlength% THEN
Maxlength% = LEN(REMOVE$(Choices$(i%),"@"))
END IF
END IF
LOOP WHILE i% = j%
Count% = i%
Rtrn$ = ""
INCR Maxlength% 'add a space
LessThanWinsize% = 0 'initialize to zero
FOR i% = 1 TO Count%
Choices$(i%) = " " + Choices$(i%)
NEXT i%
IF Count% <= Winsize% - 1 THEN
LessThanWinsize% = 1
END IF
IF LessThanWinsize% THEN 'we need to transfer Count% to Finish%