home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / alt / lang / basic / 1105 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.4 KB

  1. Path: sparky!uunet!digex.com!digex.com!not-for-mail
  2. From: bruceg@access.digex.com (Bruce Garrett)
  3. Newsgroups: alt.lang.basic
  4. Subject: Re: HELP wanted: filehandling in Visual Basic
  5. Date: 27 Jan 1993 18:45:15 -0500
  6. Organization: Express Access Online Communications, Greenbelt, MD USA
  7. Lines: 32
  8. Message-ID: <1k76qbINNrm3@digex.digex.com>
  9. References: <1993Jan26.135724.234@samba.oit.unc.edu>
  10. NNTP-Posting-Host: access.digex.com
  11.  
  12.    dil.admin@mhs.unc.edu (Dave Laudicina) writes:
  13.  
  14. >> > How can I determine whether a file (in this case a .BMP) exists in the
  15. >> > given path?
  16.  
  17. >> >If someone can tell me what I have to do to solve this problem, please,
  18. >> >mail me. I would be very grateful.
  19.  
  20. DL> You could set up a file list box for a particular drive and path 
  21. DL> and search through the file list to see if the file is in the list.
  22.  
  23. DL> I would also be interested if anyone has found a more efficient way
  24. DL> to do this.
  25.  
  26.     Why can't you use the DIR$ Function?  This function accepts a 
  27. filespec mask and returns a string containing a filename or NULL if the file 
  28. does not exist and can be repeatedly polled for all files meeting a wildcard 
  29. filespec.
  30.  
  31.     IF Len(Dir$(FileSpec$)) > 0 THEN
  32.         (stuff to do if the file exists)
  33.     ELSE
  34.         (stuff to do if it ain't there)
  35.     END IF
  36.  
  37.     Check out page 94 of the Language Reference.
  38.  
  39. -Bruce Garrett
  40.                                                                        \
  41.  --- IF Bogosity%(Opinion$) > BSThreshold% THEN Opinion$ = ""          /\
  42.  
  43.   
  44.