Simplicty and flexibility!


Function::File

MemoReadFromFile
MemoReadFromFile(MEMO FIELD,TEXT VALUE,NUMERICAL VALUE)
MemoReadFromFile(MyDestinationMemo,"C:\MyTextFiles\mytextfile.txt",1)
MemoReadFromFile(MyMemo,concat(GetCurrent("MyDocuments","deexport",MyFilenameField),1)
MemoReadfromFile(MyMemo,MyFileNameFieldFul


To read the content of a text file into a Memo field. You can overwrite the existing Memo Field, Append the content of the file to it or insert the file content at the beginning of the Memo Field.

It is no secret that Import and Export possibilities has been somewhat "stumped" in DFW. In fact it hasn't bee technically so limited as our users seem to think, but for various reasons it has been perceived as much more limited than in DFD. This has mostly been down to niggling small bits that shut the functionality away from the users. 

MemoReadFromFile() is simply a tool to read any formatted text into a Memo Field. This can be as an import/export feature in combination with MemoDecodePair(), part of processing in combination with MemoWriteToFile() - You build a text file instead of directly into a Memo Field and then read it back into DataEase via MemoReadFromFile(). It can be part of using HTML in your App... You decide!

In short this is simply a very flexible FileRead function that you can use for anything you like.

Parameters


MEMO FIELD - Destination Memo

This is the destination Memo where the content of the file is read in to. 

TEXT VALUE - File Path

The path to the text file you want to read into MEMO FIELD

NUMERICAL VALUE - Switch

The mode switch that decide which mode you want the file to be read in with:

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.

Returns/Result


Nothing.
Result: Will populated MEMO FIELD (Destination Memo) with the content of file in TEXT VALUE. This is a new class of functions called Manipulation Functions which manipulate another object than the one they are called from.

Examples


Example 1

We have a memo called MyMemo that contains "This is a test" and a text file MyText.txt that contains "This is a test too!". The text file is located in the app catalogue.

MemoReadFromFile(MyDestMemo,"MyText.txt",0)

Result in MyMemo: This is a testThis is a test too!

Example 2

We have a memo called MyMemo that contains "This is a test" and a text file MyText.txt that contains "This is a test too!". The text file is located in the app catalogue.

MemoReadFromFile(MyDestMemo,"MyText.txt",1)

Result in MyMemo: This is a test too!

Example 3

We have a memo called MyMemo that contains "This is a test" and a text file MyText.txt that contains "This is a test too!". The text file is located in the app catalogue.

MemoReadFromFile(MyDestMemo,"MyText.txt",3)

Result in MyMemo: This is a test too!This is a test

Example 4

We have a Document template stored in [users]/My Documents/DataEase/Templates/. It is a mail merging template that we will mail to the customers. It contains MailMerging Tags for Customer name. 

MemoReadFromFile(MyMemo,concat(GetCurrent("MyDocuments","/DataEase/Templates/",MyFileNameField,1)

Next step is to replace the [{Customer}] tag with the content of the field CustomerName

MemoReplace(MyMemo,"[{Customer}]",Customer)

We have now read a document template from a relative catalogue on the current PC and prepared it for printing/mailing.

Reference

This is the complimentary function to MemoWriteToFile, and it simply read the content of a File into a Memo field.

It reads it as Text. If you read an HTML file, it will display as HTML code in a normal Memo Editbox field, and as the Webpage in a WebField.

MemoReadFromFile has the same switches and formating as MemoWriteTo file.

int MemoReadFromFile(MemoToReadInto,Filename,Argument)

Argument:
0 - Append to Memo.
1 - Overwrite Memo

See Also


MemoReadFromFile
MemoDecodePair
MemoReplace
MemoReplace
WriteToFile

On the forum about MemoReadFromFile

MemoReadFromFile

Experimenting with this new function in  a dql but unable to even get it to complile let alone run.  he format is taking directly from the website 'help' for MemoReadFromFile.I've clearly got it in the wrong context but the help just...

Product: Dataease [{8}]FIVE. Written by Simon B 11/03/15 at 10:33:27

Re:MemoReadFromFile

1. THis is a prism function so it will update the Column in the Form not the GUI object, so it will actually read into the Column without you seeing it. This is intention as the same function is being used in DQL's etc, and all the GUI updating will s...

Product: Dataease [{8}]FIVE. Written by DataEase 11/03/15 at 12:12:11

Re:Re:MemoReadFromFile

Thank you.I keep getting caught out by this 'column function not gui function'.  I'm used to dataease showing what i've done when i do it.  I understand why you're approaching it this way but i wish it was made clearer for people like...

Product: Dataease [{8}]FIVE. Written by Simon B 11/03/15 at 14:33:29

Re:Re:Re:MemoReadFromFile

You can use all of these functions in DQL and anywhere in DataEase. That is the "point" of using the function format for new functionality.Where commands can only be used in DQL, a function can be used in Derivation/Validation/DQL/OML i.e. eve...

Product: Dataease [{8}]FIVE. Written by DataEase 16/03/15 at 20:36:28

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 MemoReadFromFile

New Function in 8 - MemoReadFromFile() - Read the content of a text file to a Memo (Ver. 8.0.0.1054)

This is the complimentary function to MemoWriteToFile, and it simply read the content of a File into a Memo field.It reads it as Text. If you read an HTML file, it will display as HTML code in a normal Memo Editbox field, and as the Webpage in...

Product: Dataease [{8}]FIVE. Written by DataEase 13/03/12 at 09:54:46

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