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