Results 1 to 6 of 6

Thread: Input + Output - The Same Time???

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    47

    Question

    is it possible to open a file for input and for output at the same time??

    i mean writing into the file....while reading from it

    ???
    DealMan

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    If you open a file for ex. input you won't be able to do anything to the file until you use close#1. After this you will be able to open the same file for output. But this is not at the same time. At the same time you can't do both operations to a file.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    I think when you Open a File for Binary you'll be able to Get and Put at the same time... maybe I'm just brabbling bullshit, I have no time to check it now, but if you need help look at http://www.kedaman.com

    he has a great file tutorial.. < hey keda, tha'll be $5 please.
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  4. #4
    Lively Member
    Join Date
    Nov 2000
    Location
    Québec City
    Posts
    73
    Put and Get should work, but if you don't want to access your file in binary mode you can open it in random mode

    open "yourfile" for random as #1

    this mode allows both Read and Write

  5. #5

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    47

    Wink But..

    <Krushstone>
    but will i be able to use the "input" command when i do

    open SomeFile for random as #1
    text1.text = input$(lof(1),1)
    and
    input #1,s
    close #1

    i hate using the "write" command because it leaves the ""
    anyway...i could try binary access as you all said

    i'm building a program which in it a counter will be included , telling the user how many times he used my program...
    my problem suppose to be a replacment for notepad and if my program starts opening and closing files on the form_load event, it will be slower...and the user might decide to use the ordinery notepad instead of mine.
    will it faster to read and write to the registry at the form_load event? if so....please tell me how to write to the registry and to read from it..
    thanks...
    DealMan

  6. #6
    Lively Member
    Join Date
    Nov 2000
    Location
    Québec City
    Posts
    73
    no... you can't use input in random mode

    you'll have to use put and get...

    this page could be useful to help you make your choice:

    http://www.vb-world.net/files/openstatement/

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