home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
QBAS
/
WNDTOOL5.ZIP
/
POPDIR.SUB
< prev
next >
Wrap
Text File
|
1989-04-26
|
4KB
|
82 lines
'
'$PAGE
'
'******************************************************************************
' Function : *
' *
' Purpose: *
' *
' *
' Results: *
' *
' Usage : *
' *
' *
' Date Written : 01/01/89 - Date Tested: 01/01/89 - Author: James P Morgan *
' Date Modified: - : - : *
'-----------------------------------------------------------------------------*
' NOTE: *
'******************************************************************************
' *
' SUB PROGRAM NAME (PARAMETERS) STATIC/RECURSIVE *
'-----------------------------------------------------------------------------*
' *
'============================================================================
'
SUB POPDIR(SEARCH$,SHOWITEMS%,FORE%,BACK%,HFORE%,HBACK%,QUADRANT$,SHADOW%,NUMFILES%,SELECTFILE$) STATIC
DEFINT A-Z 'make all short interger by default
REM $DYNAMIC 'allocate array off far heap
DIM FILES$(1) 'allocate an array of only 1 element
REM $STATIC 'default arrays back to Basic data segment
POPDIR.START:
ATTR=0
COUNT=&HFF00 OR ATTR 'Get number of filenames that match SEARCH$
I=INT(VARPTR(FILES$(0))) 'get pointer to start of array to hold filenames found
CALL DIR(SEARCH$,I,COUNT) 'see how many files match our filename spec.
IF (COUNT=-1) OR (COUNT = 0) THEN 'were any matching filenames found?
NUMFILES%=0 'NO
SELECTFILE$="No Files Found"
GOTO POPDIR.DONE
END IF
IF COUNT <> 0 THEN 'allocate the filename array big
REDIM FILES$(COUNT) 'enough to hold all the filenames
END IF
HEADER$=SEARCH$ 'this was the filename spec used for serach
FOR I=0 TO COUNT 'make each entry big enough to hold a filename
FILES$(I)=SPACE$(12)
NEXT
COUNT=ATTR
I=INT(VARPTR(FILES$(0)))
CALL DIR(SEARCH$,I,COUNT)
MAXITEMS=COUNT 'this many file names cab be displayed
SHOWFILES=SHOWITEMS% 'but only display this many at a time
CALL POPLIST(HEADER$,SHOWFILES,MAXITEMS,FILES$(),FORE%,BACK%,HFORE%,HBACK%,QUADRANT$,SHADOW%,SELECT.%)
SELECT.%=SELECT.%-1 'adjust
IF SELECT.%<0 THEN 'was a filename selected
SELECT.%=0 'NO
SELECTFILE$=" "
ELSE
SELECTFILE$=FILES$(SELECT.%) 'return the filename selected
ENDIF
POPDIR.DONE:
ERASE FILES$ 'free memory allocated to array
EXIT SUB 'return to caller
END SUB