Simplicty and flexibility!


Function::Memo

MemoMemoCopy
MemoMemoCopy(MEMO FIELD,MEMO FIELD2,NUMERIC VALUE)
MemoMemoCopy(MemoField,MemoField2,Switch)
MemoMemoCopy(MemoField,MemoField2,0) - Append to Memo.
MemoMemoCopy(MemoField,MemoField2,1) - Overwrite/Rep
MemoMemoCopy(MemoField,MemoField2,2) - Delete


Insert, append, overwrite or delete the value of a Memo field with the content of another memo field.

In the new Memo class the essence is to be able to manipulate and "play" with memo fields in any way you like. We have MemoCopy() that works the same way as MemoMemoCopy() but it simply appends/copies a normal DataEase field rather than a memo.

MemoMemoCopy() allow you to move the information in Memofields around and merge them together.

Parameters


MEMO FIELD

This is the destination Memo field which will be either overwritten, appended, inserted or delelted.

MEMO FIELD2

This is the value that will be appended or inserted into MEMO FIELD.


NUMERIC VALUE

This is the switch that will decide wich action the MemoMemoCopy() function will take:

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


Example 1 - Append

We have to memo fields.
Memo1: This is Memo1 
Memo2: This is Memo2

MemoMemoCopy(Memo1,Memo2,0)

Result: This is Memo1This is Memo2

Example 2 - Overwrite

We have to memo fields.
Memo1: This is Memo1 
Memo2: This is Memo2

MemoMemoCopy(Memo1,Memo2,1)

Result: This is Memo2

Example 3 - Delete

We have to memo fields.
Memo1: This is Memo1 
Memo2: This is Memo2

MemoMemoCopy(Memo1,Memo2,2)

Result: <blank>

Example 4 - Insert

We have to memo fields.
Memo1: This is Memo1 
Memo2: This is Memo2

MemoMemoCopy(Memo1,Memo2,3)

Result: This is Memo2This is Memo1



Example 5 

This example is from the Send Advanced E-Mail example in the Default Template.

if (MemoLength(Emailbody)>0,MemoCopy(MailBodyCoded,"<div>",1)+MemoMemoCopy(MailBodyCoded,Emailbody,0)+MemoCopy(MailBodyCoded,"</div>",0)+MemoReplace(MailBodyCoded,chr(13),"<br>")+MemoWriteToFile(LinkedStyles ,MailFile,1)+MemoWriteToFile(MailBodyCoded,MailFile,0)+MemoWriteToFile(MySiignature,MailFile,0),0)

This formula builds the Email body.

If Email body is not ampty >

MemoCopy a start HTML <div>
MemoMemoCopy The content of Emailbody to the new MailbodyEncoded
MemoCopy a end HTML </div>

Then we parse through the New MailbodyEncoded and replace all Text carriage returns with proper HTML <br> line break tags.
Then we write the style header to the filepath stored in virtual field Mailfile with overwrite.
Then we append the Encoded Mail body to the Mailfile.
Then we append the Email signature to the mailfile.



And this is the result. Properly formatted properly styled and with Email signature...Voila!

Reference

MemoMemoCopy

Type

Memo  Function

Purpose

This function copies, appends, or inserts a Memo into another Memo. This function will make it possible to build an advanced Memo field from many other Memo field.

Same as MemoCopy, just that it copies Memo fields into Memo instead of normal DataEase field types.

Syntax

MemoMemoCopy(MemoTo,MemoFrom,Switch)

? where MemoTo is the result Memo, MemoFrom is the memo to be copied, inserted or appended.

Switch: 0=Append, 1=Overwrite, 2=Insert at beginning.
Returns

An empty string so the function can be used as part of any derrivation without interfering with the derivation result. 

Example

Memo1 contains "DataEase" and Memo2 contains "Is great"
MemoMemoCopy(Memo1,Memo2,0)

             ? will reuslt with the Memo1 containing : DataEase is great
 

MemoMemoCopy(Memo1,Memo2,1)

             ? will result with Memo1 containing> is great

MemoMemoCopy(Memo1,Memo2,2)

             ? will result with Memo1 containing: is great DataEase

 

Notice that "MyName" has no space, because the trailing space in "My " was truncated. Whereas the words "Name is" are correctly spaced, because the string " is" had a leading space.

The Jointext function is retained, and can still be used.
Complimentary Functions

MemoCopy() - same function but copies, inserts or overwrite a Memo with a normal DataEase field or constant.
WriteToFile() - Function that will perform the same functionality, but write to a file instead of a Memo.
Chr() - Function that returns the ASCII character for a number, you will need this to insert " or NewLine into a Memo.
MemoWriteToFile() - Same as WriteToFile() but writes, inserts or appends a memo to a file.
MemoReadFromFile() - Reads a file into a memo.
 

 

See Also


On the forum about MemoMemoCopy

[@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.&nbsp;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 MemoMemoCopy


dg3_HelpView