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

[@EOF@]...

Product: . Written by alembagheri tahmas 07/12/13 at 13:37:32

Hi there,I am trying to use an external MySQL DB in dataease. I have successfully create the ODBC link and added the DB to dataease. I can also access the DB from dataease. Now, just for testing purposes, I am trying to create a simple report b...

Product: DataEase for Windows 7.x. Written by George Washington 11/04/14 at 08:26:17

no se pude exportar ahora archivos a pdf, ni a excel o otros cosa mala. en verdad creo que hace faltaen las versiones anteriores me funcionaba mas o menos bien. le hace falta a los aplicativos que se desarrollan en Dataeasegr...

Product: DataEase 8 Reporter. Written by eduardo paez 02/05/14 at 14:40:11

Thanks. Anyway I'm trying to use this fuction but it seems to me that it doesn't work on 8.2. I tried also in a DQL.There's something wrong?<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA9IAAAJ3CAYAAAB4NWk3AAAAAXNSR0IArs4...

Product: . Written by Marco Marchesi 15/02/16 at 14:50:46

[@EOF@]...

Product: Dataease [{8}]FIVE. Written by Chamil Rajindra 21/02/19 at 10:17:46

Thanks for the very good explanation!AS...

Product: . Written by afonso santos 28/10/19 at 00:50:14

I am pleased to see that the migration from Dos 4.53 is then sa 5.5 works. A really useful thing would be a compiler of SQL languages. Will you get there?Original Text:Mi compiaccio a vedere che la migrazione da Dos 4.53 รจ poi sa 5.5 funzio...

Product: . Written by Grossi Gioacchino 18/11/19 at 14:33:44

How can i delete a Style sheet?...

Product: Dataease [{8}]FIVE. Written by Rainer 22/03/21 at 11:13:10

I run W7 and since a few days&nbsp;Dataease 8.5 is not starting any more, do you have an idea? i installed it again but that did not help....

Product: Dataease [{8}]FIVE. Written by Rainer 08/06/21 at 14:12:40

[@EOF@]...

Product: . Written by Hiralal Rampul 01/12/21 at 17:47:10

On the blog about MemoReadFromFile


dg3_HelpView