Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : TN9006.ZIP
Filename : CLONIN.TXT

Output of file : CLONIN.TXT contained in archive : TN9006.ZIP
Cloning Labels
The Finale
Gilbert Catipon

Editors note: In the March Edition of TechNotes dBASE IV, we
published an article on the subject of making multiple repititions of
a singular label. That approach was interactive in nature, limiting
the focus to the usage of the label and query design screens. This
month, however, the search for customization of this idea goes
further. For those of you who want a more behind the scenes way of
accomplishing this task, this Template Language method may be more
what you need.

When it comes to printing labels, a common need that leaves some users
in a quandary is the ability to print multiple copies of the data in
any particular record.
The task is quite simple. When you print labels, just use this
modified .GEN file called LABELQTY.GEN. Then, create a query that
selects the records you wish to print. Next, add a calculated field
to that query and call it LABELQTY, using an expression for the number
of labels desired; either a literal number or memory variable
containing a numeric.

If you decide that you want arbitrary values for each record, then
modify the structure of the database and add a numeric field and call
it LABELQTY. Then, each record could be printed with a different
quantity. In this case, the presence of the actual field would
eliminate the need of a calculated field in your query.

To modify your LABEL.GEN to recognize this new field value, simply
change a few lines in the resource file LABEL.COD (listed below).
Before you go dashing through your disks to find this file, remember
that it is only included with the dBASE IV Developer's Edition. You
will find it on the Template Language Disk #2.

The code below shows segments from the LABEL.COD file. The code in
italic is the code that you will add. There's code before and after
your additions so that you know where you are.

Use the Goto menu to find the text string SET MEMOWIDTH TO 254 then
make the additions in italic.

gn_page=_pageno && capture page number for multiple copies
_wrap = .F.

gc_count = LABELQTY && Count variable.

IF ll_sample
DO Sample

Now search for the first occurrence of the line { if x then} and
continue making the modifications shown below.

{ if x then}
{ endif}

IF gc_count <= 1
gc_count = LABELQTY
gc_count = gc_count -1

{ if x then}
{ LMARG(4);}

The last modification can be made after you locate the area of code
below. Using the Goto menu, look for DO WHILE gn_line .

DO WHILE gn_line < {label_tall+lbl_vspace}

//-- modify / add this lines
IF gc_count <= 1
gc_count = LABELQTY
gc_count = gc_count -1


This is all that is needed to modify LABEL.COD. After modification
use the template language compiler to create a new .GEN file. At the
DOS level, enter


and you'll create a new LABEL.GEN file. s

  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : TN9006.ZIP
Filename : CLONIN.TXT

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: