Does anybody know how to code a function to insert a line of text into a text file and then save the change. Im sure it can be done but don't know how.
I do not know of any "insert" to a texct file. You can read the file, copy the input records to an output file while writing the new record to output at the appropriate (to you) place.
The textstream object does not have an insert method. You can either use .READALL and use instr() to find where the insertion point is, rebuild the string, and output it.
If the textfile is composed of fixed length records you may open the file for random access and put the chunks back together.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.