home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 24
/
CD_ASCQ_24_0995.iso
/
vrac
/
homonlib.zip
/
FILESIZE.BAS
< prev
next >
Wrap
BASIC Source File
|
1995-04-13
|
752b
|
31 lines
DEFINT A-Z
' $INCLUDE: 'DIR.INC'
DECLARE FUNCTION FileSize& (file$)
FUNCTION FileSize& (file$)
'****************************************************************************
'Returns a long integer representing the file size of a single file or the
' combined size of multiple files if a wildcard is passed.
'
'Should the file(s) not be found, the function will return zero.
'
'****************************************************************************
DIM DirInfo AS DirType 'This should be easy to follow.
totsize& = 0
f$ = Dir$(file$, DirInfo)
DO WHILE LEN(f$) AND DirInfo.ErrorCode = 0
totsize& = totsize& + DirInfo.EntrySize
f$ = Dir$("", DirInfo)
LOOP
FileSize& = totsize&
END FUNCTION