When I have done this I have formatted the path such as this
var trailerfile : a50 = "\\micros01\00Temp\trailer.txt" //////// FILE PATH OF DATA FILE
Then somewhere in my script, depending on my needs I call a sub proedure
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
sub write_trailerfile
fopen fn, trailerfile, write and append
if fn=0
exitcancel
endif
fwrite fn,storenum,business_date,hhmmss,@CKNUM{4},@TREMP{4},@RVC{1},@WSID{1},trailercode{1}
fclose fn
endsub
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
I nthe cas above, I have formatted some of my own variables as well as write some system variables... I think you get the idea
I did however, stop using text logs and instead just wrote to a custom table in the DB... for me it was easier to retrieve it that way