home *** CD-ROM | disk | FTP | other *** search
- 'Date: 06-21-92 (03:03)
- 'From: NICK DAVIS
- 'Subj: READ/WRITE STATUS CONTEST
- '-------------------------------------------------------------------------
- 'Unfortunately, the response to our contest was less than overwhelming.
- 'Dunno if 1) It was too hard; 2) It was too easy; 3) The time was too
- 'short; 4) The prizes weren't enough of a lure; or, 5) None of the
- 'above. Therefore, the Prize Committee will hold the prizes in
- 'abeyance and the Competition Committee will attempt to think up a
- 'better contest. As a partial consolation to those who showed
- 'interest, following is one routine which works with either QB or PDS
- 'plus Crescent's QuickPak and does most if not all of the contest's
- '"ReadStatus" routine with having to resort to ON ERROR. It can be
- 'adapted to QB or PDS without QuickPak if you're willing to use ON
- 'ERROR or ON LOCAL ERROR plus it works with both MS-DOS and DR DOS.
-
- DEFINT A-Z
- '
- '---------------------------------------------------------------------
- '
- ' == Report if a Directory Exists ==
- '
- ' Uses the Following Routines from QuickPak Professional:
- '
- ' * FUNCTION DOSError ()
- ' * FUNCTION GetDir$ (a$)
- ' * FUNCTION GetDrive ()
- ' * SUB CDir (a$)
- ' * SUB SetDrive (a$)
- '
- '---------------------------------------------------------------------
- '
- FUNCTION ValidDir (Directory$) STATIC
- '
- ValidDir = 0'---------------------------- Assume Not Valid
- DriveNow$ = CHR$(GetDrive)
- DirNow$ = DriveNow$ + ":" + GetDir$(DriveNow$)
- OldDrive = NOT DOSError
- SetDrive Directory$
- IF NOT DOSError THEN '------------------- Drive is Valid
- Current$ = LEFT$(Directory$, 2) + GetDir$(Directory$)
- IF NOT DOSError THEN '-------------- Drive is Readable
- CDir Directory$
- IF NOT DOSError THEN '--------- Directory Exists
- ValidDir = -1
- CDir Current$
- END IF
- END IF
- END IF
- SetDrive DriveNow$
- IF OldDrive THEN CDir DirNow$
- '
- END FUNCTION
-