CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Files

  1. #1
    Guest

    Files

    How do we open a file for both reading and writing in VB? In VC++, we have a mode "r+" which will allow us to open a file for both reading and writing. I the same way, do can we open a file for both reading and writing ?

    Thanks


  2. #2
    Join Date
    Dec 1999
    Location
    Baltiore, MD, USA
    Posts
    8

    Re: Files

    Open pathname For mode [Access access] [lock] As [#]filenumber [Len=reclength]

    where
    access : Read, Write, Read Write

    BTW this is described in MSDN/VB help files


  3. #3
    Join Date
    Dec 1999
    Location
    Israel
    Posts
    101

    Re: Files

    Using Access Mode, you can open file for read/write, for example:
    Open "filename.txt" For Append Access Read Write As #1 --> a+
    Open "filename.txt" For Input Access Read Write As #1 --> w+

    Good Luck!


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

Featured