To write the content of a Memo to a text file. THe content will be written as is, so if the content is HTML you will create a HTML file (remember to use the right extension).
You can overwrite (mode:1), Append (Mode:0-Default) and delete a file with this function. It also include modes for appending with new line etc.
MemoToWrite: Memo
This is the memo that you want to write to the file or append to the file.
FileName: Text
This is the full path to the file you want to create. You can combine it with GetCurrent("AppPath") e.l. to get relative filenames to app.
Mode: Integer
This is the mode you want to use for the write,append,delete:
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.
This function is part of a pair, where the opposite is MemoReadFromFile.
It is implemented to allow users to export the content of a memo 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