good day everyone! I have a problem regarding to my program. i want to create a multiple text file. To be clear to you, i'll give an example.

for example I want create a textfile named as text1.txt and another textfile text2.txt.
What possibly is the solution to prevent the 1st txt file to be overwritten by the 2nd txt file.

Is there any easy code that can I use?

Thank you in advance! :)

Recommended Answers

All 2 Replies

for example I want create a textfile named as text1.txt and another textfile text2.txt.
What possibly is the solution to prevent the 1st txt file to be overwritten by the 2nd txt file.

Don't write the same thing to both files.

Why would text1.txt get overwritten by text2.txt? they are two different files.

if you are talking about writing two files at the same time then it simply a matter of opening them on different file unit numbers

open "text1.txt" for output on #1
open "text2.txt" for output on #2

print #1, "this will go in text1"
print #2, "this will go in tesxt2"

close #1
close #2
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.