Howdy, Stranger!

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

Categories

File names

Does anyone know how to input a filename of a file and use it in my programmes?


Comments

  • : Does anyone know how to input a filename of a file and use it in my programmes?

    :



    input "filename: "; filename$






  • Sorry, I didn't make it clear enough. I wish to input filenames of existing files from, say, DOS.

    For example, I have a file called 'list.txt' in c: .Now I want to input it into my programme and, lets say, change the name so it becomes backwards, ie: 'tsil.txt' . But I don't want to programme specific files into my programmes. I want the user to be able to select files to do this. Does this make sense? Is there any way to do this. I would be truely grateful. Thanx


  • no problem =)



    try something like this, but be careful(when you are testing it), and use trash files like some .txt files you created just for this purpose.





    REM Source ---------------------------------



    INPUT "filename: ", file1$

    INPUT "new-filename: ", file2$



    OPEN file1$ FOR INPUT AS #1

    OPEN file2$ FOR OUTPUT AS #2



    DO

    INPUT #1, character$

    PRINT #2, character$

    LOOP UNTIL EOF(1)



    CLOSE 2#

    CLOSE 1#



    KILL file1$



    REM End of source-code ---------------------





    Is this what you wanted???

    I hope it helps, bye




  • Thanx, your idea work out perfectly. I appreciate the help.



    Cam


  • : Thanx, your idea work out perfectly. I appreciate the help.

    :

    : Cam

    :



    No problem at all dude!

    And thanks for telling me that

    it helped you out somehow =)






Sign In or Register to comment.