home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
clarion
/
labels3.zip
/
LABELS3.COM
/
README
< prev
Wrap
Text File
|
1989-11-30
|
4KB
|
98 lines
I wrote LABELS3 to illustrate a method I worked out to print 3 across labels
in designer, a request I have seen many times on the Clarion BBS.
FILES INCLUDED:
README This file.
LABELS3.APP Designer 2009 Application File to demonstrate method.
LABEL1.CLA Include file, sets fields for first label.
LABEL2.CLA Include file, sets fields for second label.
CUSTOMER.DAT Test data file with 5 records, so you can see that it
CUSTOMER.K01 works.
FIELDS.SCR In case you don't have 2009 Designer to look at the
app, this is what the report and conditional fields
look like.
BASIC METHOD:
I set up the report detail to print 3 labels. The rightmost label has the
actual fields from the file (for example, CUS:NAME). The Other 2 labels
have MEMORY fields which correspond to the CUS fields (for example MEM:NAME_1
and MEM:NAME_2). Having done this, the trick is now to get one record's data
into the first label fields, the next into the second label fields, the third
record into the third label fields, and only then print the detail line.
A handy method I have often used for inserting Clarion code statements into a
designer app is to use a conditional field. Since the 2009 model file puts
the conditional fields into the loop which reads records from the file, the
conditional field can check which label is being done and take appropriate
action. For labels 1 and 2, the appropriate action is to copy the CUS fields
into the MEM fields, and then Cycle to get the next record. The flag
labels_done# is used to keep track of the current label. It is set to 0 in
the setup procedure.
The code for each conditional is contained in an INCLUDE file, to avoid the
255 character limit and for readability.
When end of file is reached on the first or second label, that label is
duplicated twice or three times.
SELECTOR AND FILTER FIELDS IN THE REPORT
The above works fine if the report consists of all records in the file.
But if a selector field is used, Designer puts the selector check before the
conditional fields, so if the last line of labels has 1 or 2 labels they will
not print. Use a filter instead if you can.
If you use a filter, you must put the filter condition into LABEL1.CLA and
LABEL2.CLA, so labels which don't belong will be filtered out. The first line
of the files should become:
IF ~(@FILTER) THEN CYCLE .
Replace @FILTER with your filter condition.
You will also have to change the second label's conditional field, so that
in the 'If False' case you check whether the label will be filtered out before
setting labels_done# = 0. Otherwise, if a label is filtered out of the third
position the first two won't be printed.
LABEL POSITIONING
I have not actually set up the report so that the fields print properly onto
actual labels. I merely wanted to illustrate the concepts.
TWO LABELS ACROSS
Of course, the method could be adapted easily for two lebels. Eliminate the
second label's MEM fields, and move the 'If False' part of the second
conditional field into 'If False' part of the first conditional field.
QUESTIONS OR PROBLEMS?
Leave a note for me on the Clarion BBS, or at the address below.
Chris Guilmartin
Cybernated Automation Corporation / Micro-Crane, Inc.
3561 NW 126 Ave.
Coral Springs, FL 33065
November 30, 1989