Best way tro write to a file

Ignoring dataports, what is the best way to write to a text file? f.write or stream datatype? I need a simle example of an outstream please?

Jason, The following code is from the online help on the Outstream data type. FileMyHTML.CREATE(‘main.html’); FileMyHTML.CREATEOUTSTREAM(OutStream); OutStream.WRITETEXT(’’); OutStream.WRITETEXT(); OutStream.WRITETEXT(’’); OutStream.WRITETEXT(’’)My Page); OutStream.WRITETEXT(’’); OutStream.WRITETEXT(); OutStream.WRITETEXT(‘

Hello world!

’); OutStream.WRITETEXT(); OutStream.WRITETEXT(’’); FileMyHTML.CLOSE(); Vars= FileMyHTML Type = File OutStream = Outstream Of course it can be used the write a plain text file and not the html format as in the example. I have used both the file.write and outstream in applications an I’m not sure which is best as both worked fine. Maybe some other posting might give some advantages and distadvantages of each. Regards, Chris.

Or you could just FileMyHTML.TEXTMODE=TRUE; FileMyHTML.CREATE(‘main.html’); FileMyHTML.WRITE(’’); FileMyHTML.WRITE(); FileMyHTML.WRITE(’’); FileMyHTML.WRITE(’’)My Page); FileMyHTML.WRITE(’’); FileMyHTML.WRITE(); FileMyHTML.WRITE(‘

Hello world!

’); FileMyHTML.WRITE(); FileMyHTML.WRITE(’’); FileMyHTML.CLOSE(); Why bother with all the overheads with streams?? Paul Baxter

If I use this way to write to a file, I overwrite my file with each open. I would like to have one file per person, and open it and continue to write into it. It is supposed to work as a kind of a trace file to help me locate an error we have. That is why I do not want it overwritten. Is that possible? Regards Sandra

Sandra, To do this you could include the USERID and/or TIME in the file name. This would make them unique so the file will not be overwritten. Chris.

Thanks a lot Chris, after working on it for two days now, I found the solution. Thanks Sandra[:)]

hi to avoid over writting the file, you have to place the cusror at the end of the file every time you want to write to the same file. harikesh