open and closing files without using Common Dialog Routines

I want to be to open and save text and random access files without using the Common Dialog routines. Does anyone have code that they can share with me that will accomplish this task? The routine(s) should display a dialog box that will allow a file to be opened and read from and, a dialog box that will allow a file to be saved and written to.

thanks,

RRP

Comments

  • [b][red]This message was edited by GameTroy at 2003-1-4 19:48:6[/red][/b][hr]
    : I want to be to open and save text and random access files without using the Common Dialog routines. Does anyone have code that they can share with me that will accomplish this task? The routine(s) should display a dialog box that will allow a file to be opened and read from and, a dialog box that will allow a file to be saved and written to.
    :
    : thanks,
    :
    : RRP
    :

    '-------------------
    well i don't know what the common dialog routines are but here is the code part of the open and read or open and write part of your program...

    FOPEN = "C:Folderfile.txt"
    'use the drive you want to use in place of c
    'use the folder you want to use in place of folder
    'use the file name and extention in place of file.txt

    Open FOPEN for Output As #1

    Write #1, "text to be put in the file"
    Write #1, 12345


    'put any type of variable in place of the string or the numbers



    Close #1

    Open FOPEN for Input As #1

    Do until EOF(1)
    'in the Parenthacese put any number for the file
    'number of the file you are opening

    Input #1, Variable1
    Input #1, Variable2

    'you can input or write as many times as you want but when you
    'write it earases the old file

    Loop
    Close #1


    ....
    as for the part of the program the user sees you will need to use the drive box , folder box, and file list box to browse the path you need to open or save to. That should help a little.



    Moses 1:39 - "For behold, this is my work and my glory-to bring to pass the immortality and eternal life of man."


    -Troy





Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion