Question Control Chr Functions

Good day sirs,

I just want to know how CHR works in printings. Changing the text to a different font styles.
Anyway it is just a basic question, from the codes below.

Code:
FORM HEADER
          ' ACTIVE REALTY & DEVELOPMENT CORPORATION' AT 1 'Page No. : ' AT 155 PAGE-NUM form "999"
          ' PRINTED DATE:' AT 1 TODAY FORMAT '99/99/9999' ' PRINTED TIME :' STRING(TIME,'HH:MM:SS')
          ' TRACKING SYSTEM' AT 1 SKIP(1)
          ' PRINTED BY: ' AT 1 iuser AT 15 SKIP
          ' DISBURSEMENT WITH CV' AT 75 SKIP(1)
          ' BUYER NAME: ' AT 1 f-acctname AT 15 FORM "x(35)" SKIP
          ' Number               Trans Date Buyer Name                       Received By     Purpose/Remarks                               Disb/CV Date    Amount       ' AT 1
          ' ==================== ========== ================================ =============== ============================================= =============== =============' AT 1
         /*01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
                     1         2         3         4         5         6         7         8         9         10        11        12        13        */
WITH FRAME header1 NO-BOX NO-LABEL PAGE-TOP WIDTH 350.

OUTPUT TO VALUE(o-file) paged page-size 60.
VIEW FRAME header1.
DEF VAR vdbamt AS DECIMAL FORMAT "->>,>>>,>>9.99".
DEF VAR vcvamt AS DECIMAL FORMAT "->>,>>>,>>9.99".
  PUT CONTROL CHR(15) + CHR(27) + CHR(77). 
  PUT 'Disbursement/s:' AT 2 SKIP(1).
  FOR EACH disbursement WHERE disbursement.buyer_code EQ f-buyercode
     BREAK BY disbursement.buyer_code.
 
  ACCUM db_amt(TOTAL BY disbursement.buyer_code).

  PUT db_no AT 2
      disbursement.trans_date AT 23 FORM '99/99/9999'
      buyer_name FORM "X(25)" AT 34
      rcvd_by FORM "X(10)" AT 67
      purpose AT 83
      db_date AT 129
      db_amt AT 143.

  IF LAST-OF(buyer_code) THEN DO:
      ASSIGN vdbamt = ACCUM TOTAL BY buyer_code db_amt.
      PUT SKIP(1).
      PUT fill('=',43) form "x(43)" at 115 SKIP.
      PUT 'TOTAL DISBURSEMENT AMOUNT:' AT 116 vdbamt AT 143.
      PUT fill('=',43) form "x(43)" at 115 SKIP.
  END.

  END.

  PUT SKIP(2).
  PUT 'Fund Receipt/s:' AT 2 SKIP(1).

  FOR EACH fund_rcpt WHERE fund_rcpt.buyer_code EQ f-buyercode
     BREAK BY fund_rcpt.buyer_code.
 
  ACCUM cv_amt(TOTAL BY fund_rcpt.buyer_code).

  PUT fundr_no AT 2
      fund_rcpt.TRANS_date AT 23 FORM '99/99/9999'
      fund_rcpt.buyer_name FORM "X(25)" AT 34
      'CV - ' AT 67 cv_no AT 72
      Remarks1 + ' ' + Remarks2 AT 83 FORMAT 'X(30)'
      fund_rcpt.cv_date AT 129
      cv_amt AT 143.

  IF LAST-OF(fund_rcpt.buyer_code) THEN DO:
      ASSIGN vcvamt = ACCUM TOTAL BY fund_rcpt.buyer_code cv_amt.
      PUT SKIP(1).
      PUT fill('=',43) form "x(43)" at 115 SKIP.
      PUT 'TOTAL CV AMOUNT:' AT 116 vcvamt AT 143.
      PUT fill('=',43) form "x(43)" at 115.
     
  END.
  END.

  OUTPUT CLOSE.
     IF ex-term THEN DO:
        RUN repviewer.w(vprintername,o-file,vsharedprinter,vprinterpath).
     END.
     ELSE IF o-print THEN DO:
        IF NOT vsharedprinter THEN
           DOS SILENT TYPE VALUE(o-file) > prn.
        ELSE DOS SILENT TYPE VALUE(o-file) > VALUE(vprinterpath).
     END.

I just want to Italicize or bold the text of the line "PUT 'Disbursement/s:' AT 2 SKIP(1)." and line "PUT 'Fund Receipt/s:' AT 2 SKIP(1).". I am adding some '+ chr(27)' before 'AT' but it doesnt change.

Maybe thers some functions I need to know in the put control line above.

Thanks for any replies guys.
 

RealHeavyDude

Well-Known Member
I think you need to use somthing like put control "" so that they are correctly escaped.

Heavy Regards, RealHeavyDude.
 

TomBascom

Curmudgeon
You cannot effectively use control sequences within DISPLAY statements. (In theory you might get away with embedding them *within* the *data* being displayed -- but that will probably impact the layout in mysterious ways...)

PUT is for unstructured "streaming" output. CONTROL tells Progress that it is dealing with special characters and is not available as part of the DISPLAY statement -- which is highly structured and handles many layout, pagination and formatting functions that PUT knows nothing about.

You can probably mix and match. I.e.

Code:
display "some plain text".
put control italics_on.
display "some italic text".
put control italics_off.
display "non italic text.

But this gets tricky because DISPLAY can sometimes decide to move things around if the form hasn't been completely laid out. And you are making assumptions about where the cursor is at the beginning and end of the DISPLAY statements. (It's probably pretty sequential when you're printing but might not be on a screen.)
 
Top