Category : BASIC Source Code
Archive   : QBFAQR01.ZIP
Filename : RWSTAT.BAS

 
Output of file : RWSTAT.BAS contained in archive : QBFAQR01.ZIP
'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


  3 Responses to “Category : BASIC Source Code
Archive   : QBFAQR01.ZIP
Filename : RWSTAT.BAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/