Category : Files from Magazines
Archive   : DBMS0291.ZIP
Filename : FOXPRO2.FEB

 
Output of file : FOXPRO2.FEB contained in archive : DBMS0291.ZIP


PROCEDURE DumpMemo
***********************************************************
* Program : DumpMemo.Prg
* Author : P. L. Olympia & Kathy Cea
* Purpose : Copies contents of selected records of a
* : specified memo field to a target file.
* Syntax : DO DumpMemo WITH DbfName, MemFld, RecBeg,
* : RecEnd, OutFile
* : RecBeg & RecEnd are the beginning and ending
* : record numbers to copy. Outfile is the target
* : file. DbfName is the .dbf file. MemFld is the
* : memo field.
* Note : Error trapping excluded from code.
***********************************************************
PARAMETER DbfName, MemFld, RecBeg, RecEnd, Outfile

*-- Store, then change, environment
SafeSW = SET("SAFETY")
SET SAFETY OFF

rec_str = STR(RecBeg,4) && for use as macro

*-- We need the following two statements to make sure
* OutFile is created if not already present

SET ALTERNATE TO (OutFile) && Note filename substitution
CLOSE ALTERNATE

USE (DbfName) && Another indirect file
&rec_str && move pointer to start

SCAN WHILE (recno() >= RecBeg .AND. recno() <= RecEnd ;
.AND. !(EMPTY(MemFld)))
COPY MEMO &MemFld TO (OutFile) ADDITIVE && Exports memo
ENDSCAN

SET SAFETY &SafeSW
RETURN