home *** CD-ROM | disk | FTP | other *** search
/ Hall of Fame / HallofFameCDROM.cdr / open / qbinters.lzh / EXIST.BAS < prev    next >
BASIC Source File  |  1989-04-23  |  1KB  |  39 lines

  1. 'Sat  Apr 22, 1989   11:01:08 am
  2. '*****************************************************************************
  3. 'This routine checks if a file exists on the default drive. If the returned
  4. 'value is 0 then the file  does NOT exist, if 1 the file exists.
  5. 'NOTE: This routine does not work right now. Do not use.
  6. '*****************************************************************************
  7. DECLARE FUNCTION exist (file$)
  8. TYPE RegType
  9.      ax    AS INTEGER
  10.      bx    AS INTEGER
  11.      cx    AS INTEGER
  12.      dx    AS INTEGER
  13.      bp    AS INTEGER
  14.      si    AS INTEGER
  15.      di    AS INTEGER
  16.      flags AS INTEGER
  17. END TYPE
  18.  
  19. DIM SHARED inregs AS RegType, outregs AS RegType
  20.  
  21. file$ = "junk"
  22. PRINT exist(file$)
  23.  
  24. FUNCTION exist (file$)
  25.      file$ = file$ + CHR$(0)
  26.      file = SADD(file$)
  27.      inregs.ax = (23 * 256): inregs.cx = 0: inregs.dx = file
  28.      CALL interrupt(&H21, inregs, outregs)
  29.      al = outregs.ax: IF al > 0 THEN al = 0 ELSE al = 1
  30.      exist = al
  31. END FUNCTION
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.