home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / alt / lang / basic / 1102 < prev    next >
Encoding:
Text File  |  1993-01-27  |  1.7 KB  |  53 lines

  1. Newsgroups: alt.lang.basic
  2. Path: sparky!uunet!destroyer!sol.ctr.columbia.edu!usenet.ucs.indiana.edu!silver.ucs.indiana.edu!bdwheele
  3. From: bdwheele@silver.ucs.indiana.edu (Brian Wheeler)
  4. Subject: Re: HELP wanted: filehandling in Visual Basic
  5. Message-ID: <C1H320.IEM@usenet.ucs.indiana.edu>
  6. Sender: news@usenet.ucs.indiana.edu (USENET News System)
  7. Nntp-Posting-Host: silver.ucs.indiana.edu
  8. Organization: Indiana University
  9. References: <1993Jan26.135724.234@samba.oit.unc.edu>
  10. Date: Tue, 26 Jan 1993 17:53:59 GMT
  11. Lines: 40
  12.  
  13. In <1993Jan26.135724.234@samba.oit.unc.edu> dil.admin@mhs.unc.edu (Dave Laudicina) writes:
  14.  
  15. >>Basically, it boils down to this:
  16. >> How can I determine whether a file (in this case a .BMP) exists in the
  17. >> given path?
  18. >>
  19. >>If someone can tell me what I have to do to solve this problem, please,
  20. >>mail me. I would be very grateful.
  21. >>
  22. >You could set up a file list box for a particular drive and path 
  23. >and search through the file list to see if the file is in the list.
  24.  
  25. >I would also be interested if anyone has found a more efficient way
  26. >to do this.
  27. >Thx Dave L
  28.  
  29. the Dir$ function Returns the name of a file matching a filespec.  if the
  30. filespec is a filename without wildcards, it returns whether or not the file
  31. exists.
  32. Here's what I do:
  33.  
  34. const False = 0
  35. Const True = Not False
  36.  
  37. Function Exists(Filespec$)
  38.     if Dir$(FileSpec$) <> "" then
  39.         Exists = True
  40.         Exit Function
  41.     else
  42.         Exists = False
  43.     end if
  44. End Function
  45.  
  46. Brian Wheeler
  47.  
  48. -- 
  49. ******************************************************************************
  50. * Brian 'Nautical' Wheeler - These are my opinions, do you hear me?  MINE!
  51. * cat flames > /dev/null                    "Wombats are our friends" - Me
  52. ******************************************************************************
  53.