Condividi tramite


MEMLINES( ) Function

Returns the number of lines in a memo field.

MEMLINES(MemoFieldName)

Return Values

Numeric

Parameters

  • MemoFieldName
    Specifies the name of the memo field. If the memo field is in a table that isn't open in the current work area, preface the memo field name with the table alias and a period.

Remarks

The number of lines in a memo field is determined by the current value of SET MEMOWIDTH.

Example

The following example scans three records in the employee table and uses MEMLINES( ) to determine whether or not there is data in the notes memo field and when page breaks should occur. The last_name data for the record appears, along with the notes (if there is data in the memo field) or a message indicating that there are no notes for that record.

CLOSE DATABASES
CLEAR
SET TALK OFF
CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
USE employee  && Open Employee table

SET MEMOWIDTH TO 65
gnLine = 1
GOTO 2
SCAN NEXT 3
   gnMemoSize = MEMLINES(notes)
   IF gnMemoSize = 0
      STORE .T. TO glNoMemo
      STORE 1 TO gnMemoSize
   ELSE
      STORE .F. TO glNoMemo
   ENDIF
   IF gnLine + gnMemoSize > 65
      EJECT
      gnLine = 1
   ENDIF
   @ gnLine,2 SAY 'Last Name: '+ last_name
   gnLine = gnLine +1
   @ gnLine ,2 SAY 'Notes: ' 
   ?? IIF(glNoMemo, 'No notes ',notes)
   gnLine = gnLine + gnMemoSize + 2
   IF gnLine > 24
      gnLine = 1
      CLEAR
   ENDIF
ENDSCAN

See Also

_MLINE | ALINES( ) | ATCLINE( ) | ATLINE( ) | COPY MEMO | MLINE( ) | MODIFY MEMO | SCATTER | SET MEMOWIDTH