home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / clarion / labels3.zip / README < prev   
Text File  |  1989-11-30  |  4KB  |  98 lines

  1.  
  2. I wrote LABELS3 to illustrate a method I worked out to print 3 across labels
  3. in designer, a request I have seen many times on the Clarion BBS.
  4.  
  5.  
  6.  
  7. FILES INCLUDED:
  8.  
  9. README                  This file.
  10. LABELS3.APP             Designer 2009 Application File to demonstrate method.
  11. LABEL1.CLA              Include file, sets fields for first label.
  12. LABEL2.CLA              Include file, sets fields for second label.
  13. CUSTOMER.DAT            Test data file with 5 records, so you can see that it
  14. CUSTOMER.K01            works.
  15. FIELDS.SCR              In case you don't have 2009 Designer to look at the
  16.                         app, this is what the report and conditional fields
  17.                         look like.
  18.  
  19.  
  20.  
  21. BASIC METHOD:
  22.  
  23. I set up the report detail to print 3 labels.  The rightmost label has the
  24. actual fields from the file (for example, CUS:NAME).  The Other 2 labels
  25. have MEMORY fields which correspond to the CUS fields (for example MEM:NAME_1
  26. and MEM:NAME_2). Having done this, the trick is now to get one record's data
  27. into the first label fields, the next into the second label fields, the third
  28. record into the third label fields, and only then print the detail line.
  29.  
  30. A handy method I have often used for inserting Clarion code statements into a
  31. designer app is to use a conditional field. Since the 2009 model file puts
  32. the conditional fields into the loop which reads records from the file, the
  33. conditional field can check which label is being done and take appropriate
  34. action.  For labels 1 and 2, the appropriate action is to copy the CUS fields
  35. into the MEM fields, and then Cycle to get the next record.  The flag
  36. labels_done# is used to keep track of the current label. It is set to 0 in
  37. the setup procedure.
  38.  
  39. The code for each conditional is contained in an INCLUDE file, to avoid the
  40. 255 character limit and for readability.
  41.  
  42. When end of file is reached on the first or second label, that label is
  43. duplicated twice or three times.
  44.  
  45.  
  46.  
  47.  
  48.  
  49. SELECTOR AND FILTER FIELDS IN THE REPORT
  50.  
  51. The above works fine if the report consists of all records in the file.
  52. But if a selector field is used, Designer puts the selector check before the
  53. conditional fields, so if the last line of labels has 1 or 2 labels they will
  54. not print. Use a filter instead if you can.
  55.  
  56. If you use a filter, you must put the filter condition into LABEL1.CLA and
  57. LABEL2.CLA, so labels which don't belong will be filtered out. The first line
  58. of the files should become:
  59.  
  60.         IF ~(@FILTER) THEN CYCLE .
  61.  
  62. Replace @FILTER with your filter condition.
  63.  
  64. You will also have to change the second label's conditional field, so that
  65. in the 'If False' case you check whether the label will be filtered out before
  66. setting labels_done# = 0. Otherwise, if a label is filtered out of the third
  67. position the first two won't be printed.
  68.  
  69.  
  70.  
  71.  
  72. LABEL POSITIONING
  73.  
  74. I have not actually set up the report so that the fields print properly onto
  75. actual labels.  I merely wanted to illustrate the concepts.
  76.  
  77.  
  78.  
  79.  
  80. TWO LABELS ACROSS
  81.  
  82. Of course, the method could be adapted easily for two lebels. Eliminate the
  83. second label's MEM fields, and move the 'If False' part of the second
  84. conditional field into 'If False' part of the first conditional field.
  85.  
  86.  
  87.  
  88. QUESTIONS OR PROBLEMS?
  89.  
  90. Leave a note for me on the Clarion BBS, or at the address below.
  91.  
  92. Chris Guilmartin
  93. Cybernated Automation Corporation / Micro-Crane, Inc.
  94. 3561 NW 126 Ave.
  95. Coral Springs, FL 33065
  96.  
  97. November 30, 1989
  98.