home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Zodiac Super OZ
/
MEDIADEPOT.ISO
/
FILES
/
13
/
N_B_V203.ZIP
/
DTA-ALL.TXT
< prev
next >
Wrap
Text File
|
1996-07-04
|
3KB
|
64 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME DTA-ALL .TXT ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
There are several functions included in this library that create, load and
use a "DTA" ( Data Transfer Area ). These functions were created in support
of fDIR$, fDIRlist%, and the fTREExxx functions but are available to you
also.
Before using the DTA you must first understand just how DOS works when you
request directory information:
First an area of memory is set aside, by DOS, to load the information on
the requested file into. It is then your job to access this area, read and
unpack the data. When you call fDIRfirstFile% the DTA is set and, if a file
match is found, it's data is loaded into this area. With each subsequent
call to fDIRnextFile% the next file's info is loaded into the DTA until the
last matching file has been passed.
Getting the info out of the DTA and into some usable form is handled by a
series of small functions: fDTAfile$ file's name
fDTAattr? file's attribute
fDTAtime?? time stored
fDTAdate?? date stored
fDTAsize& size in bytes
To make things more compatible with our time and date routines there are
two functions that return the files' time/date in their component parts:
DTA2HMS
DTA2YMD
Now, there are 3 other routines that make the fTREExxx functions work but
unless you are adventurous or know what you are about I would advise you
simply ignoring them for safety's sake!
fDTAPTR??? far pointer to the DTA
fDTAget$ the DTA data
DTAput overwrite DTA data
There are also 2 higher order functions:
fFileAttr$ which converts fDTAattr? into a string eg: "A..."
fDTAunpack$ which converts all DTA data into a requested format
Of these, fDTAunpack$ is the one that makes calls to all the rest
unnecessary as it will unpack the DTA into any directory format you
can conceive! You only need call fDTAfirstFile and fDTAnextFile to load
the DTA first.
<<<BUT>>>
fDIR$, fDIRlist%, & fTREExxx will do it ALL for you automatically so.......