Function MemoTran() Foundation

Replaces hard and soft returns in a character string or memo field.

Syntax
MemoTran( <cString>    , ;
         [<cNewHardCR>], ;
         [<cNewSoftCR>]  ) --> cNewString
Parameters
<cString>
<cString> is a character string or the contents of a memo field in which the return characters are replaced.
<cNewHardCR>
The character <cNewHardCR> is used to replace all hard returns (Chr(13)+Chr(10)). By default a semicolon (;) is used.
<cNewSoftCR>
The character <cNewSoftCR> is used to replace all soft returns (Chr(141)+Chr(10)). By default a blank space (Chr(32)) is used.
Return

The return value of MemoTran() is a copy of <cString> in which the returns are replaced.

Description

The function MemoTran() changes the formatting characters for returns to printable characters. When automatic word wrap is on, MemoEdit() inserts the control characters (Chr(141)+Chr(10)) into the text. These characters (soft returns) must be deleted before output of the text to a printer.

The control characters Chr(13)+Chr(10) (hard return) are inserted by MemoEdit() into the text when the user presses the Return key. Hard returns must be deleted when the contents of a memo field are to be printed as a block paragraph.

Examples
MemoTran()

// In the example, addresses from an address file are listed 
// and the notes (a memo field) are printed in a block paragraph. 
// The Epson control characters for block paragraph are sent 
// to the printer. 

PROCEDURE Main 
   USE Address NEW 

   SET PRINTER ON 
   SET CONSOLE OFF 

   DO WHILE .NOT. Eof() 
      ? LastName, FirstName 
      ? Street 
      ? City + ",", State,  Zip 
      ? Chr(27)+Chr(97)+Chr(3)       // Epson control characters for 
                                     // block paragraph 
      ?? MemoTran( Notes, " ", " " ) // deletes all returns 
                                     // and outputs memo field 
      ?? Chr(27)+Chr(97)+Chr(0)      // Epson control characters for 
                                     // left justified paragraph 
      SKIP 
   ENDDO 

   SET PRINTER OFF 
   SET CONSOLE ON 
RETURN 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.