Results 1 to 4 of 4

Thread: FreeFile

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 1999


    My application is used by a number of users, all accessing(writing) to the same file.
    Currently like so:

    Open Filename For Append Access Write Lock Write As #1

    If a user is writing to the file & another user tries to access the file, permission is denied. Error handler displays a message. Try later!!!

    Should I hard-code file number, #1 or use Freefile to obtain next available number. Only one user can open & write to the file at once...

    What are the benefits of using freefile, espcially with multiple users?


  2. #2
    Join Date
    Jul 1999


    You should use freefile in preference to a number every time in my opinion. Benefit being it is guaranteed to work (at least, it won't bust due to invalid file number).

    There is no real point not using FreeFile (apart from 2 extra lines of code...damn! )

    Hope that clears it up


    - Chris
    If it ain't broke - don't fix it

    [This message has been edited by chrisjk (edited 11-30-1999).]

  3. #3


    also, using #1 may cause untold damage to "that comma-delimited file that i left open in notepad, which my customer desperately needs for tomorrow morning". Bitter, bitter experience!

    examples of mad people who probably dont use FREEFILE:...
    Evel Kneivel, Charly Manson, that feller out of hellraiser. (names changed to stop nasty libel proceedings)!


    Email me:

  4. #4
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    the Netherlands


    Using Freefile has nothing to do with multiple users. If you open multiple files from your application, it can be hard to make sure you haven't used the filenumber for another file already. Using Freefile makes sure you get a filenumber that isn't used already by your application. Also using #1 (or #9 or whatever) isn't as clear as using:

    hLogFile = FreeFile
    Open Filename For Append Access Write Lock Write As #hLogFile

    Now the variable gives a clue about the purpose of the file, so if you open the file in line 100 of your code and you write to it in line 1050, it will be more easy to understand if you have to modify the app in a year or so.

    So in my opinion, using FreeFile is recommended.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width