MemoWrit()

MEMOWRIT()

Write a memo field or character string to a text file on disk

Syntax

      MEMOWRIT( <cFileName>, <cString>, [<lWriteEof>] ) --> lSuccess

Arguments

<cFileName> is the filename to read from disk. It must include the file extension. If file to be read lives in another directory, you must include the path.

<cString> Is the memo field or character string, to be write to <cFile>.

<lWriteEof> Is a logic variable that settle if the “end of file” character – CHR(26) – is written to disk. This parameter is optional. By default is true (.T.)

Returns

Function returns true (.T.) if the writing operation was successful; otherwise, it returns false (.F.).

Description

This a function that writes a memo field or character string to a text file on disk (floppy, HD, CD-ROM, etc.) If you not specified a path, MEMOWRIT() writes <cFileName> to the current directory. If <cFileName> exists, it is overwritten.

There is a third parameter (optional), <lWriteEof>, (not found in CA-Cl*pper) which let to programmer change the default behavior of – always – to write the EOF character, CHR(26) as in CA-Cl*pper.

If there is no third parameter, nothing change, EOF is written as in CA-Cl*pper, the same occurs when <lWriteEof> is set to .T. But, if <lWriteEof> is set to .F., EOF char is Not written to the end of the file.

MEMOWRIT() function is used together with MEMOREAD() and MEMOEDIT() to save to disk text from several sources that was edited, searched, replaced, displayed, etc.

Note that MEMOWRIT() do not use the directory settings SET DEFAULT.

Examples

      *  This example uses MEMOWRIT() to write the contents of a character
         variable to a text file.

         cFile   := "account.prg"
         cString := MEMOREAD( cFile )

         IF At( "Melina", cString ) == 0            // check for copyright
            MEMOWRIT( cFile, cCopyright + cString ) // if not, add it!
         ENDIF

Compliance

Clipper

Platforms

All

Files

Library is rtl

Seealso

MEMOEDIT(), MEMOREAD(), HB_MEMOWRIT()

Advertisements

4 responses to “MemoWrit()

  1. Pingback: Harbour All Functions – M | Viva Clipper !

  2. Pingback: OEM to ANSI | Viva Clipper !

  3. Pingback: Harbour Memo Functions | Viva Clipper !

  4. Pingback: Harbour RG Summary | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s