To create, overwrite or append to any type of text file (including HTML) with the content of a field or string(255). You can use this function to write the content of any DataEase field except Memo to a text file.
in DFD we had Output etc, to create "advanced" export files, but in DFW export has been challenging. With WriteToFile() and MemoWriteToFIle() we have a solution that can make and modify any Text file on the fly.
StringToWrite: String
The text/number/date etc. we want to write to the file up to 255 characters a go.
File to write to: String
The full path to the "export file". if you omit the path it will be created in the Applicaiton catalogue. Use GetCurrent("AppPath") to place it relative to the application.
Mode: Integer
The mode for the write. i.e if you want to overwrite, delete, append or insert the string with or without line feed.
0=Append value to memo field.
1=Overwrite memo field with new value.
2=Delete/Blank Content of memo field.
3=Insert value at beginning of memo field.
4=Append value to Memo with CR in front (Start on new line)
5=Insert value at beginning of memo with CR after.
It is implemented to allow users to write a string to a text file.
So why would we want to do that?
With the new Memo manipulation class, memos can be manipulated in any way one like, they are containers for export data, import data, documents, webpages etc etc.
Wouldn't it be neat if one could save or share the content of these fields with oneself or the rest of the world? It is not so easy to send a memo field to someone, but we can all attach a field as a document.
One test users actually created a full website in a DataEase 8 application, and then export all the dynamically generated pages to a webserver with MemoWriteToFile once a day...
The neat thing with MemoWriteToFile is that it is not limited to writing to a file, it can also append to a file, overwrite a file or simply delete a file.
int MemoWriteToFile(MemoToWrite,Filename,Mode)
Mode:
0=Append value to memo field.
1=Overwrite memo field with new value.
2=Delete/Blank Content of memo field.
3=Insert value at beginning of memo field.
4=Append value to Memo with CR in front (Start on new line)
5=Insert value at beginning of memo with CR after.
Again....use your imagination!
Product: Dataease [{8}]FIVE. Written by DataEase 20/03/15 at 10:34:53
Product: Dataease [{8}]FIVE. Written by Simon B 23/03/15 at 12:13:11
Product: Dataease [{8}]FIVE. Written by DataEase 25/03/15 at 14:21:47
Product: Dataease [{8}]FIVE. Written by DataEase 22/02/12 at 09:48:32
Product: Dataease [{8}]FIVE. Written by DataEase 16/10/12 at 16:41:16