vern123
asked on
err Log in a txt file
I need A function so that if I call the function and it records/post the string to the last entry of the textfile specified in the pathname.
Private Function(PathName as string,ErrText as string)
if the function were called 4 times, A further example
Private Function("c:/err/err.txt", "err1")
Private Function("c:/err/err.txt", "err2")
Private Function("c:/dd/other.txt" ,"otherfil e")
Private Function("c:/err/err.txt", "err3")
the resulting file err.txt would look like in c:/err/
err1
err2
err3
the resulting file other.txt would look like in c:/dd/
otherfile
if file exists in dir it would append the text
if file is not found in dir then a new one must be created.
The file should be closed and saved after.
I need the complete working code for this Function
Thank you.
Private Function(PathName as string,ErrText as string)
if the function were called 4 times, A further example
Private Function("c:/err/err.txt",
Private Function("c:/err/err.txt",
Private Function("c:/dd/other.txt"
Private Function("c:/err/err.txt",
the resulting file err.txt would look like in c:/err/
err1
err2
err3
the resulting file other.txt would look like in c:/dd/
otherfile
if file exists in dir it would append the text
if file is not found in dir then a new one must be created.
The file should be closed and saved after.
I need the complete working code for this Function
Thank you.
ASKER
Edited text of question
ASKER
Edited text of question
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks mike, but I also need the function to add the file
(If it does not already exist) with the correct name/path
(If it does not already exist) with the correct name/path
It does that. The Append file access method creates the file if it doesn't exist already.
ASKER
:)
ASKER