Simplicty and flexibility!


Function::Memo

MemoWriteToFile
MemoWriteToFile(MemoToWrite,Filname,Mode)
MemoWriteToFile(MyMemo,"C:\temp\memoexp.txt",1)
retval := MemoWriteToFile(Letter,FileName,1) .


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.

Parameters


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.

Returns/Result


Nothing.

Examples


Reference

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!

See Also


On the forum about MemoWriteToFile

MemoWriteToFile(),MemoReadFromFile(),MemoStringFrom(), MemoStringBetween() sample

Download Sample Seeing is believing, so please find attached a sample that showcase what you are looking for. In this sample we...

Product: Dataease [{8}]FIVE. Written by DataEase 20/03/15 at 10:34:53

Re:MemoWriteToFile(),MemoReadFromFile(),MemoStringFrom(), MemoStringBetween() sample

Got some time to sit down to look at this example.  Can't say much more than wow! ... Simple small scripts doing some clever stuff here, ans showing how to use functions to do the type of thing I'm looking for.Also showing off other things...

Product: Dataease [{8}]FIVE. Written by Simon B 23/03/15 at 12:13:11

Re:Re:MemoWriteToFile(),MemoReadFromFile(),MemoStringFrom(), MemoStringBetween() sample

We are glad that you are getting a glimpse &nbsp;of the sunny side of the DE8 coin.It is the biggest challenge for DE8 that it is deceptively similar to previous versions of DFW, when in reality it is a completely different beast altogether.<b...

Product: Dataease [{8}]FIVE. Written by DataEase 25/03/15 at 14:21:47

On the blog about MemoWriteToFile

New function in 8 - MemoWriteToFile() - Write the content of a memo to a text file (Ver. 8.0.01053)

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 ca...

Product: Dataease [{8}]FIVE. Written by DataEase 22/02/12 at 09:48:32

MemoWriteToFile(),MemoReadFromFile(),MemoStringFrom(), MemoStringBetween() sample

Download Sample Seeing is believing, so please find attached a sample that showcase what you are looking for. In this sample we...

Product: Dataease [{8}]FIVE. Written by DataEase 20/03/15 at 10:47:00


dg3_HelpView