home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR9 / WDOS0793.ZIP / LESSER.ZIP / DEMOFIND.BAS next >
BASIC Source File  |  1993-05-28  |  891b  |  28 lines

  1. '  demofind.bas - a demonstration driver for FINDIR.ASM
  2. '  compiled with BC 7.1, switch "/O"
  3. '  linked with LINK 5.1 to FINDIR, NOFLTIN, NOCOM and NOLPT
  4. '       switches "/E/NOE"
  5.  
  6.     declare function findir$ ()
  7.     defstr f,t
  8.  
  9.     if len(findir) = 0 then             'Too early version of DOS
  10.         print "This program requires DOS 3.0 or later"
  11.         end                             'Abnormal termination
  12.     end if
  13.     let filename = findir + "testfile"
  14.     if len(dir$(filename)) = 0 then             'Not there yet?
  15.         print tab(5) findir"TESTFILE didn't exist, ";
  16.         open filename for output as #1
  17.         let text = "TESTFILE exists"
  18.         print #1, text
  19.         close #1
  20.         print "but now it has been written."
  21.     else
  22.         open filename for input as #1
  23.         line input #1, text
  24.         print tab(5) findir; text
  25.     endif
  26. end
  27.  
  28.