I'll take a stab at this, off the cuff...

GOSUB PRINT.HEADINGS
NUM.FIELDS=DCOUNT(@RECORD,@FM)
FOR F.POS = 1 TO NUM.FIELDS
   NUM.VALUES=DCOUNT(@RECORD<F.POS>,@VM)
   FOR V.POS = 1 TO NUM.VALUES
      NUM.SUBVS=DCOUNT(@RECORD<F.POS,V.POS>,@SVM)
      FOR S.POS = 1 TO NUM.SUBVS
         PLINE=FOLD(@RECORD<F.POS,V.POS,S.POS>,55)
         PLINE.CNT=DCOUNT(PLINE,@FM)
         IF PLINE.CNT + LINE.CNT GT MAX.LINES THEN
            GOSUB PRINT.FOOTER
            GOSUB PRINT.HEADER
         END
         FOR LINE.NUM = 1 TO PLINE.CNT
            PRINT PLINE<LINE.NUM>
            LINE.CNT += 1
         NEXT LINE.NUM
         PRINT
         LINE.CNT += 1
      NEXT S.POS
   NEXT V.POS
NEXT F.POS

You will need to supply the additional supporting internal subroutines
and logic to populate @RECORD but this should be a pretty easy to
understand core from which you can expand to your needs.

This should work for both UV and UD but in all honesty, I've not used UD
directly.

Hope that helps.
BobW

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Al DeWitt
Sent: Monday, August 22, 2005 8:17 AM
To: [email protected]; [EMAIL PROTECTED]
Subject: [U2] Formatting Help

I have a multi-value field within a multi-value field (sub-values).  The
length of each sub-value can be up to 70 characters.  I need to reformat
and print the value so that each sub-value is no longer than 55
characters.  To complicate matters I need to know ahead of time how many
"lines" the reformatted value takes up so that if it's greater than the
page length I can do a page eject and new headings before I print the
value.  I've never do this before so how should I approach this?



Al DeWitt

Stylmark, Inc.

763-574-8705
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to