CLOSE DATABASES MXTEMPFILES = SYS(5) + SYS(2003) + "\" cFile = MXTEMPFILES + "memofile.DBF" USE (cFile) IN 0 ALIAS memofile ** set up temporary name index data file cFile = MXTEMPFILES + "DECINDEX.DBF" IF FILE(cFile) ERASE (cFile) ENDIF cFile = MXTEMPFILES + "DECINDEX" ** FREE just in case you have some open DATABASE (I know you started ** with CLOSE DATA, but ... Just in case CREATE TABLE (cFile) FREE ; (section C(21), name C(50), page C(5), fname C(40), lname C(30)) * Index the table because if the use skip through all the pages in report and then * Decide to skip back the names are appened again INDEX ON Name TAG DECINDEX USE USE (cFile) ORDER DECINDEX IN 0 ALIAS decindex ** this record has a large memo cRNo = "01100" **** Creating the cursor used for REPORT CREATE CURSOR cReport (Memo M) SELECT memofile nLines = ALINES(arrLines,memofile.memo,.t.,CHR(13)) FOR asd = 1 TO nLines INSERT INTO cReport VALUES (CHRTRAN(arrLines[asd],CHR(10),[])) NEXT SELECT cReport cReportName = MXTEMPFILES + "memo" REPORT FORM (cReportName) PREVIEW CANCEL ********************************************************** ********************************************************** FUNCTION eIndex(lcName) lcFName = LEFT(lcName,AT("/",lcName)-1) SEEK PADR(lcFName,50) IN decindex IF NOT FOUND("decindex") lcLName = SUBSTR(lcName,AT("/",lcName)+1) APPEND BLANK IN decindex REPLACE name WITH lcLName + "," + lcFName,; page WITH TRANSFORM(_pageno),; fname WITH lcFName,; lname WITH lcLName IN decindex ENDIF RETURN "" ENDFUNC ********************************************************** **********************************************************