Article ID: 114256
Article Last Modified on 12/3/2003
XLABEL.DBF - label data records with an additional count field (DUP)
DUPLIX.DBF - database that holds the duplicated records; recreated each
session
DUPLABEL.LBX (and .LBT) - label layout form referencing DUPLIX fields
DUPLABEL.PRG - program that fills DUPLIX database with duplicates
To set up the files:
CREATE duplix
DUPLIX contains those fields from XLABEL.DBF that will be used by the
label form. If you want all the fields, issue the following commands,
and then remove the count field DUP from the DUPLIX structure:
USE XLABEL
COPY STRUCTURE to DUPLIX
CREATE LABEL DUPLABEL
In Visual FoxPro, add the DUPLIX table to the Data Environment of the
label.
SET TALK OFF
* Open databases.
IF USED('DUPLIX')
SELECT duplix
ELSE
USE duplix
ENDIF
SELECT 0
IF USED('XLABEL')
SELECT xlabel
ELSE
USE xlabel
ENDIF
* Create blank merge file.
SET SAFETY OFF
SET TEXTMERGE TO hold
SET SAFETY ON
SET TEXTMERGE ON NOSHOW
* Cycle through labels, outputting each to the HOLD file
* for the number of times stated in XLABEL.DUP field.
SCAN
FOR i=1 TO xlabel.dup
\\<<xlabel.co>><<xlabel.contact>><<xlabel.addr>>
\
ENDFOR
ENDSCAN
* NOTE: The double backslash prevents an initial carriage return,
* which would result in the first label being blank when printed.
* Close the merge file.
SET TEXTMERGE OFF
SET TEXTMERGE TO
* Prepare the DUPLIX database to receive the new labels.
SELECT duplix
SET SAFETY OFF
ZAP
SET SAFETY ON
* Add in the new labels to the blank DUPLIX database.
APPEND FROM hold.txt TYPE SDF
* Send out the labels.
LABEL FORM duplabel PREVIEW
Additional query words: VFoxWin FoxDos FoxWin repeat
Keywords: kbcode KB114256