PRINT

Syntax

PRINT {any_lit|_var|_col} position[format_command[format_cmd_params]...]...

Description

Puts data on the page at a specified position.

Parameters

Parameter Description

{any_lit | _var | _col}

Specifies the data to be printed.

Dates can be contained in a date column or variable, or in a string literal, column, or variable. When you are using EDIT or DATE with the PRINT command, a date in a string literal, column, or variable must be in an acceptable format. See the description of EDIT for further details.

position

A position qualifier consisting of (line, column, width), where column and width are numbers that denote characters and spaces. Line, column, and width are all optional. If line or column is omitted, the print position is set by default to the current position, which is the position following the last printed item. Width is set by default to the width of the text that is being printed. Position can be relative. See the POSITION command for a full description and examples of relative positioning.

format_command

[format_cmd_params]

Specifies optional formatting commands and parameters.

Format Commands

The PRINT command has the following format commands::

  • BACKGROUND

  • BOLD

  • BOX

  • CENTER

  • CODE-PRINTER

  • DATE

  • EDIT

  • FILL

  • FOREGROUND

  • MONEY

  • NOP

  • NUMBER

  • ON-BREAK

  • SHADE

  • UNDERLINE

  • WRAP

Note:

The SHADE and BOX format options are not supported for output to HTML format.

Some of these format commands can be used in combination with others and some are mutually exclusive. The following tables show which can be used together. An X indicates that they can be used together.

  BACKGROUND/ FOREGROUND BOLD BOX CENTER CODE-PRINTER DATE/ EDIT/ MONEY/ NUMBER

BACKGROUND/ FOREGROUND

 

X

 

X

 

X

BOLD

X

 

X

X

 

X

BOX

X

X

 

X

 

X

CENTER

X

X

X

   

X

CODE-PRINTER

           

DATE/ EDIT/ MONEY/ NUMBER

X

X

X

X

   

FILL

X

X

X

X

   

MATCH

X

X

X

X

   

NOP

X

X

X

X

X

X

ON-BREAK

X

X

X

X

 

X

SHADE

X

X

X

X

 

X

UNDERLINE

X

X

 

X

 

X

WRAP

X

X

X

     
  FILL MATCH NOP ON-BREAK SHADE UNDERLINE WRAP

BACKGROUND/ FOREGROUND

X

X

X

X

X

 

X

BOLD

X

X

X

X

X

X

X

BOX

X

X

X

X

X

 

X

CENTER

X

X

X

X

X

X

 

CODE- PRINTER

   

X

       

DATE/ EDIT/ MONEY/ NUMBER

   

X

X

X

X

 

FILL

   

X

X

X

X

X

MATCH

   

X

X

X

X

 

NOP

X

X

 

X

X

X

X

ON- BREAK

X

X

X

 

X

X

X

SHADE

X

X

X

X

 

X

X

UNDERLINE

X

X

X

X

X

 

X

WRAP

X

 

X

X

X

X

 

The following sections describe the PRINT format commands.

BOLD

BOLD causes the string or number to print in bold type.

For HP LaserJet printers, the appropriate boldface font must be loaded in the printer.

For PostScript printers, the appropriate boldface must be defined in the PostScript startup file, postscri.str.

See the DECLARE-PRINTER Command Arguments table for information about which fonts can be in boldface font.

For line printers, when the BEFORE-BOLD and AFTER-BOLD arguments on the DECLARE-PRINTER command are used, the specified strings are added before and after the data that is to be in boldface. If BEFORE-BOLD and AFTER-BOLD are not specified, BOLD has no effect.

For example:

print &name (+1, 20) bold
print 'Your account is in arrears' (1,1)  bold

BOX

BOX draws a one-line-deep graphical box around the printed data. This option has no effect for line printers.

For example:

print &grand_total (+5, 20) box
print 'Happy Birthday !!' (1,1)  box

Note:

For HP LaserJet printers using proportional fonts, BOX and SHADE cannot determine the correct length of the box because it varies with the width of the characters printed. BOX and SHADE work well with fixed-pitch fonts and with all PostScript fonts.

Note:

The BOX format option is not supported for output to HTML format.

CENTER

CENTER centers the field on a line. The position qualifier for column is ignored. For example:

print  'Quarterly Sales'  (1)  center

 CODE-PRINTER

CODE-PRINTER

CODE-PRINTER has the following syntax:

Syntax Description
CODE-PRINTER = printer_type

Specify values for printer type, such as HT, HP, PS, LP, HTML, HPLASERJET, POSTSCRIPT, and LINEPRINTER.

CODE-PRINTER 

Specify the characters or strings that are added to program sequenced for printing. These characters or strings are not for display as they are placed behind the page buffer. This ensures that the alignment of the printed data is not distorted by the white space due to the characters that are programmed not for display.

CODE-PRINTER=HT

Preserves the rich text formatting when printed as HTML or PDF.

Note: You must have PDF library PDFlib upgraded to version 8.0.1.

You must specify the printer type for which this data is to be used. The report is ignored if it is printed to a different printer type. If necessary, you can send a different sequence to another type with a second PRINT statement.

For example:

encode '<27>[5U' into $big_font
encode '<27>[6U' into $normal_font
...
print $big_font (0, +2) code-printer=lp
print &phone () edit '(xxx) xxx-xxxx'
print $normal_font () code-printer=lp

In this example, the two CODE-PRINTER arguments, $big_font and $normal_font sequences into the output without overwriting any data in the page buffer. Sequences printed with the CODE- PRINTER argument are positioned by the regular line and column positioning. However, unlike the PRINT command, the current print location after execution is the beginning location where the CODE-PRINTER string was placed. Multiple coded strings printed using the same line and column location appear in the output in the same sequence in which they were printed.

DATE

You cannot use DATE with numeric columns or variables. DATE indicates that the field is to be formatted with the DATE-EDIT-MASK from the current locale. (See the ALTER_LOCALE command.) If this entry is not set, then the date is printed according to the following rules shown in the Date table.

Column Type Default Mask If not set

DATETIME

SQR_DB_DATE_FORMAT

See the Default Database Formats table for the format that is used.

DATE

SQR_DB_DATE_ONLY_FORMAT

See the DATE Column Formats table for the format that is used.

TIME

SQR_DB_TIME_ONLY_FORMAT

See the TIME Column Formats table for the format that is used.

EDIT

EDIT has the following syntax:

EDIT  edit_format

EDIT causes each field to be edited before it is printed. The three types of edits are::

  • Text edit

  • Numeric edit

  • Date edit

The following table lists the text edit format characters:

Character Description

X

Use character in field.

B

Insert blank.

~ (tilde)

Skip character in field.

R[n]

Reverse sequence of string for languages such as Hebrew. The optional number indicates right justification within length indicated.

Any other character, such as punctuation, in a text edit mask is treated as a constant and is included in the edited field.

The characters 8, 9, 0, V, and $ are illegal in a text edit mask because they are used to indicate that the mask is for a numeric edit.

The following table lists the numeric edit format characters:

Character Description

8

Digit, zero fill to the right of the decimal point, trim leading blanks (left-justify the number).

9

Digit, zero fill to the right of the decimal point, space fill to the left.

0

Digit, zero fill to the left.

$

Dollar sign, optionally floats to the right.

B

Treated as a 9, but if a value is zero, the field is converted to blanks.

C

Entered at the end of the mask, causes the comma and period characters to be transposed when the edit occurs. This is to support monetary values for which periods delimit thousands and commas delimit decimals. (Example: 1.234,56).

E

Scientific format. The number of 9s after the decimal point determines the number of significant digits displayed. The E can be uppercase or lowercase; the display follows the case of the mask.

V

Implied decimal point.

MI

Entered at the end of the mask, causes a minus to appear at the right of the number.

PR

Entered at the end of the mask, causes angle brackets (< >) to be displayed around the number if the number is negative.

PS

Entered at the end of the mask, causes parentheses to be displayed around the number if the number is negative.

PF

Entered at the end of the mask, causes floating parentheses to be displayed around the number if the number is negative.

NA

Entered at the end of the mask, causes NA to be displayed if the numeric column variable is null. The case of NA follows that of the mask.

NU

Entered at the end of the mask, causes blanks to be displayed if the numeric column variable is null.

.

Decimal point.

,

Comma.

Characters other than those listed in the Numeric Edit Format Characters table are not allowed for numeric edit masks and cause errors during processing.

The following table shows sample edit masks and resulting fields:

Mask Value Display

999.99

34.568

34.57

9,999,999V9999

123,456.7890

123,4567890

8,888,888.888

123,456.789

123,456.789

9,999

1234

1,234

9,999

123

123

09999

1234

01234

9999

–123

–123

9999

–1234

****

9999

12345

****

9999mi

–123

123-

9999pr

–123

< 123>

999999ps

–123

( 123)

999999pf

–123

(123)

9999na

(null)

NA

9999nu

(null)

(blank)

$$9,999.99c

1234.56

$1.234,56

$$9,999.99

1234.56

$1,234.56

$$9,999.99

12.34

$ 12.34

$$$,$$9.99

12.34

$12.34

9.999e

123456

1.235e+05

B9,999

0

(blank)

B9,999

12345

12,345

(xxx)bxxx-xxxx

2169910551

(216) 991-0551

xxx-xx-xxxx

123456789

123-45-6789

~~xx~xx

ABCDEFGHIJ

CDFG

r10

ABCDEFG

GFEDCBA

The following example shows some uses of edit masks:

print #total (7,55,0)  edit $999,999.99               ! $ 12,345.67
print #total (7,55,0)  edit $$$9,999.99               ! $12,345.67
print #total (7,55,0)  edit 999,999.99pr              ! < 12,345.67>(if neg)
print #comm  (7,55,0)  edit b99,999.99                ! Blank if zero
print &cnum  (16,1,0)  edit 099999                    ! 001234
print #cat   (5,10,0)  edit 9.999E                    ! 1.235E+04
print #phone (16,60,0) edit (xxx)bxxx-xxxx            ! (216) 397-0551
print #total (7,55,0)  edit £££9,999.99               ! Dollar-Symbol £

The following table lists the date edit format codes:

Character Description

YYY  YY  Y

Last 3, 2, or 1 digit of the year. On input, for calculating the 4-digit year, the current century, decade, or both are used. For example, a 9 using the Y mask would result in the year 1999 if the current year is in the 1990s.

YYYY  SYYYY

4-digit year, S prefixes BC dates with "-".

RR

Last 2 digits of year; for years in other centuries. See the Date Edit Format Code-RR table.

CC or SCC

Century; S prefixes BC dates with "–".

BC AD

BC/AD indicator.

Q

Quarter of year (1,2,3,4; JAN–MAR=1).

RM

Roman numeral month (I–XII; JAN=I).

WW

Week of year (1–53) when week 1 starts on the first day of the year and continues to the seventh day of the year.

W

Week of the month (1–5) when week 1 starts on the first day of the month and ends on the seventh.

DDD

Day of year (1–366).

DD

Day of month (1–31).

D

Day of week (1–7). Sunday is the first day of the week.

DAY

Name of day.

DY

Abbreviated name of day.

ER

Japanese Imperial Era. Returns the name of the Japanese Imperial Era in the appropriate kanji (Heisei is the current era).

EY

Year of the Japanese Imperial Era. Returns the current year within the Japanese Imperial Era.

Note: The common Japanese date format is 'YYYY<nen>MM<gatsu>DD<nichi>' where <nen>, <gatsu>, and <nichi> are the kanji strings for year, month, and day respectively.

J

Julian day; the number of days since Jan 1, 4713 BC. Numbers specified with J must be integers.

AM PM

Meridian indicator.

HH

Assumes 24-hour clock unless meridian indicator is specified.

HH12

Hour of day (1–12).

HH24

Hour of day (0–23).

SSSSS

Seconds past midnight (0–86399).

N NN NNN NNNN NNNNN NNNNNN

Fractions of a second. Precise to microseconds; however, for most hardware and databases, this much accuracy is not attainable.

MONTH

Name of month.

MON

Abbreviated name of month.

MM

Month (01–12; JAN=01).

MI

Minute (0–59).

SS

Second (0–59).

|

Used to concatenate different masks.

Note:

If the last two digits of the year are between 00 and 49, the return date is in the current century. If the last two digits of the year are between 50 and 99, the return date is in the century after the current one.

Last 2 Digits of Current Year 2-Digit Year is 00–49 2-Digit Year is 50–99

00–49

The return date is in the current century.

The return date is in the century before the current one.

50–99

The return date is in the century after the current one.

The return date is in the current century.

All masks can be used by the strtodate function except for CC, SCC, Q, W, and WW.

A backslash forces the next character into the output from the mask. For example, a mask of The cu\rre\nt \mo\nth is Month results in the output string of The current month is January. Without the backslashes, the output string would be The cu04e7t january is January.

A vertical bar can be used as a delimiter between format codes; however, in most cases the bar is not necessary. For example, the mask 'YYYY|MM|DD' is the same as 'YYYYMMDD'.

Any other character, such as punctuation, in a date edit mask is treated as a constant and is included in the edited field. If the edit mask contains spaces, it must be enclosed in single quotes (').

The masks MON, MONTH, DAY, DY, AM, PM, BC, AD, and RM are case-sensitive and follow the case of the mask entered. For example, if the month is January, the mask Mon yields Jan and MON yields JAN.

All other masks are case-insensitive and can be entered in either uppercase or lowercase. In addition, National Language Support is provided for the following masks: MON, MONTH, DAY, DY, AM, PM, BC, and AD.

See the ALTER-LOCALE command in the SQR Samples section for additional information.

If the value of the date field being edited is Mar 14 2004 9:35, the edit masks produce the results in the following table.

Edit Mask Result

dd/mm/yy

14/03/04

DD-MON-YYYY

14-MAR-2004

'Month dd, YYYY'

March 14, 2004

MONTH-YYYY

MARCH-2004

HH:MI

09:35

'HH:MI PM'

09:35 AM

YYYYMMDD

20040314

MM.DD.YYYY

03.14.2004

Mon

Mar

DD|D|DDD

143073

In addition to being used with the EDIT argument, edit masks can be used with the MOVE, CONCAT, DISPLAY, and SHOW commands, and with the edit function of the LET command. You edit the field using the supplied mask before storing or displaying it.

When a date with missing date components, time components, or both is displayed or printed, the defaults are as shown in this list:

  • The default year is the current year.

  • The default month is the current month.

  • The default day is one.

  • The default time is zero (00:00:00.000000).

For example, assuming today is September 7, 2004, the following assignment would produce an equivalent date-time of September 1, 2004 13:21:00.000000:

let $date1 = strtodate('13:21','HH:MI')

Edit masks can be changed dynamically by storing them in a string variable and referencing the variable name preceded by a colon (:). For example:

move  '$999,999.99'  to  $mask
print  #total  (5,10)  edit  :$mask
show  #total  edit  :$mask

When a date that is stored in a string literal, column, or variable is printed with an edit mask, it must be in one of the following formats:

  • The format specified by the environment variable SQR_DB_DATE_FORMAT, or the corresponding setting in the pssqr.ini file.

  • One of the database-dependent formats, as listed in the Default Database Formats table.

  • The database-independent format, 'SYYYYMMDD[HH24[MI[SS[NNNNNN]]]]'.

When a date column or variable is printed without an edit mask, the date is printed in the format specified by the environment variable SQR_DB_DATE_FORMAT or the corresponding setting in the pssqr.ini file. If this has not been set, then the date is printed in the primary database format (the first entry) listed in the Default Database Formats table.

This applies to DISPLAY, MOVE, and SHOW commands as well as PRINT.

The following table lists default date formats for each database.

Database Default Database Formats

Oracle

DD-MON-YY

ODBC

MM-DD-YYYY

DB2

YYYY-MM-DD-HH:MI:SS.NNNNNN YYYY-MM-DD

Database DATE Column Formats

DB2

YYYY-MM-DD

ODBC

DD-MON-YYYY

Database TIME Column Formats

DB2

HH24.MI.SS

ODBC

HH24:MI:SS

FILL

FILL fills the page with the specified character or string as indicated by the print position and length.

The following example prints a line of stars and then a line of dashes followed by stars:

print  '*'  (1,1,79)  fill        ! Fill line with *'s
print  '-*'  (+1,20,40)  fill     ! Fill with '-*' characters.

FOREGROUND/BACKGROUND

When you specify a color on the PRINT command, its scope is that of the PRINT command. If you do not define the specified color name, then the setting for default is used. Use the color name none to deactivate color for the specified area.

PRINT {any_lit|_var|_col} 
[FOREGROUND =({color_name_lit|_var|_col}|{rgb})]
[BACKGROUND =({color_name_lit|_var|_col}|{rgb})]

MATCH

MATCH has the following syntax:

MATCH  match_text  { line_num_lit|_var|_col } 
{ column_num_lit|_var|_col }  print_text ...

MATCH compares a field to a list of key values and if a match is found, prints the corresponding string at the specified line and column. If the match_text contains white space, it must be enclosed in single quotes ('). Any number of match texts can be tested, but each must have its own line, column, and print_text. If a match is not found, the unmatched field is printed at the position specified in the parentheses. Line and column positions for each matched string are treated as fixed or relative positions depending on the type of positioning used in the position qualifier for the PRINT command. For example:

 print  &type_buyer  (20,12)  match
	A 20 12 Casual
	B 20 22 Impulsive
	C 21 12 Informed
	D 21 22 Choosey

To use relative line and fixed-column positioning, for example, you could use the following code:

print  $state  (0,25)  match
	OH 0 25 Ohio
	MI 0 37 Michigan
	NY 0 25 'New York'

The column positions are treated as fixed locations due to the fixed 25 positions declared in parentheses.

MONEY

MONEY indicates that the column or variable is to be formatted using the MONEY-EDIT-MASK from the current locale (see the ALTER_LOCALE command). This can be used only with a numeric column or variable.

NOP

NOP suppresses the print command, causing no operation to be executed. This argument is useful for temporarily preventing a field from printing. For example:

print  &ssn  (1,1)  nop								
 Hide the social security number.

NUMBER

NUMBER indicates that the column or variable is to be formatted with the NUMBER-EDIT-MASK from the current locale (see the ALTER-LOCALE command). This argument can be used only with a numeric column or variable.

ON-BREAK

ON-BREAK has the following syntax:

 ON-BREAK [PRINT={ALWAYS|CHANGE|CHANGE/TOP-PAGE|NEVER}]
[SKIPLINES={num_lit|_var|_col}]
[PROCEDURE=procedure_name[(arg1[ ,argi]...)]]
[AFTER=procedure_name[(arg1[ ,argi]...)]]
[BEFORE=procedure_name[(arg1[ ,argi]...)]]
[SAVE=txt_var]
[LEVEL=nn]
[SET=nn]

ON-BREAK causes the specified action in a tabular report when the value of a field changes (a break occurs). The default action prints the field only when its value changes (PRINT=CHANGE). ON-BREAK has the following qualifiers:

  • PRINT specifies when the break field is printed.

    • ALWAYS duplicates the break field for each detail group.

    • CHANGE prints the value only when it changes.

      This is the default.

    • CHANGE/TOP-PAGE prints the value both when it changes and at the top of each new page.

    • NEVER suppresses printing.

  • SKIPLINES specifies how many lines to skip when the value changes.

  • PROCEDURE specifies the procedure to be invoked when the value changes.

    This qualifier cannot be used with either the AFTER or BEFORE qualifier.

  • AFTER and BEFORE procedures specify procedures to invoke either after or before the value changes.

    If no rows are fetched, neither procedure is run. AFTER and BEFORE can be used only within a SELECT paragraph.

  • The sequence of events is shown here:

    • SAVE indicates a string variable in which the previous value of a break field is stored.

    • LEVEL specifies the level of the break for reports containing multiple breaks.

      For example, a report sorted by state, county, and city might have three break levels: state is level 1 (the most major), and city is level 3 (the most minor). When a break occurs, other breaks with equal or higher level numbers are cleared. The level number also affects the sequence in which AFTER and BEFORE procedures are processed.

    • SET assigns a number to the set of leveled breaks in reports with more than one set of independent breaks.

Following is the sequence of events for a query containing ON-BREAK fields:

  1. Any BEFORE procedures are processed in ascending LEVEL sequence before the first row of the query is retrieved.

  2. When a break occurs in the query, the following events occur:

    • AFTER procedures are processed in descending sequence from the highest level to the level of the current break field.

    • SAVE variables are set with the new value.

    • BEFORE procedures are processed in ascending sequence from the current level to the highest level break.

    • Any breaks with the same or higher level numbers are cleared so that they do not break on the next value.

    • If a PROCEDURE has been declared, the procedure is invoked.

    • If SKIPLINES was specified, the current line position is advanced.

    • The value is printed (unless PRINT=NEVER was specified).

  3. After the query finishes (at END-SELECT) any AFTER procedures are processed in descending level sequence, for example:

    begin-select
    state  (+1,1,2)  on-break level=1  after=state-tot  skiplines=2
    county (,+2,14)  on-break level=2  after=cnty-tot  skiplines=1
    city   (,+2,14)  on-break level=3  after=city-tot
    ...
    end-select
    

    The breaks are processed in the following way:

    • When city breaks, the city-tot procedure is executed.

    • When county breaks, first the city-tot procedure is executed, then the cnty-tot procedure is executed.

    • When state breaks, the city-tot, cnty-tot, and state-tot procedures are processed in that sequence.

      If any BEFORE breaks were indicated, they would also be processed automatically, after all of the AFTER breaks and in sequence from lower to higher level numbers, for example:

      begin-select
      state  (+1,1,2) on-break level=1 before=bef-state after=state-tot
      county (,+2,14) on-break level=2 before=bef-cnty after=cnty-tot
      city   (,+2,14) on-break level=3 before=bef-city after=city-tot
      ...
      end-select
      

Now when state breaks, this sequence of procedures is executed:

  • City-tot

  • Cnty-tot

  • State-tot

  • Bef-state

  • Bef-cnty

  • Bef-city

When program flow enters the query at BEGIN-SELECT, the three BEFORE procedures are executed in sequence:

  • Bef-state

  • Bef-cnty

  • Bef-city

After the last row is retrieved, at END-SELECT, the three AFTER procedures are executed in sequence:

  • City-tot

  • Cnty-tot

  • State-tot

The SAVE qualifier saves the previous break value in the specified string variable for use in an AFTER procedure. You may want to print the previous break field with a summary line:

print  &state  (+1,1)  on-break  after=state-tot  save=$old-state

The SET qualifier enables you to have subreports with leveled breaks. Because the ON-BREAKs are separated into sets, the associated leveled breaks in each set do not interfere with each other.

begin-select
state  (+1,1,2)  on-break  set=1  after=state-tot  level=1

SET=1 associates this leveled break with other breaks having the same set number.

SHADE

Draws a one-line deep, shaded graphical box around the printed data. For line printers, this argument has no effect.

print 'Company Confidential' (1,1)  shade
print &state (+2, 40) shade

Note:

For HP LaserJet printers using proportional fonts, BOX and SHADE cannot determine the correct length of the box because it varies with the width of the characters printed. BOX and SHADE work well with fixed-pitch fonts and with all PostScript fonts.

Note:

The SHADE format option is not supported for output to HTML format.

UNDERLINE

UNDERLINE prints the specified data with underlined characters. For line printers, UNDERLINE generates backspace and underscore characters, which emulates underlining. For example:

print &name (+1, 45) underline
print 'Your account is in arrears' (1,1)  underline

WRAP

WRAP wraps text at word spaces. Additional text is moved to a new line. WRAP has the following syntax:

WRAP {line_length_lit|_var|_col}
{max_lines_lit|_var|_col}[KEEP-TOP]
[STRIP=strip_chars][ON=break_chars][R]
[LINE-HEIGHT={line_height_lit|_var|_col}]

line_length_lit|_var|_col

WRAP specifies the maximum paragraph width in characters.

Note:

After a string wraps, the current position is one character to the right of the last character in the column. When a string ends on the last position of a line, an implicit line feed causes the new current position to be the first character of the following line. In the SETUP section, use the DECLARE-LAYOUT command to make the page width one character wider than the right edge of the wrapped text to avoid generating an implicit line feed.

In this example, the line position is 1 for each of the three wrapped fields: note1, note2, and note3.

print &comment (48,20,0) wrap 50 3 ! Paragraph is 50
                                   ! characters wide,
                                   ! with a maximum
                                   ! depth of 3 lines.

print  &note1    (1,20,30)  wrap  30  4
print  &note2    (1,+2,30)  wrap  30  4
print  &note3    (1,+2,30)  wrap  30  4

The current print position after a wrap occurs at the bottom right edge of the wrapped paragraph. To continue printing on the same line, you must use a fixed line number for the next field.

max_lines_lit|_var|_col

Specifies the maximum paragraph depth in lines. Usually, the line length and maximum lines are indicated with numeric literals. However, WRAP can also reference numeric variables or columns. This is useful when you want to change the width or depth of a wrapped paragraph during report processing. The numeric variable can optionally be preceded by a colon (:), for example:

print  $comments  (1,30) wrap  #wrap_width  6
print  $message   (5,45) wrap  #msg_wid  #msg_lines

KEEP-TOP retains the current line position except if a page break occurs, in which case, line 1 is used as the current line position. The default action is to set the next print position at the bottom of the wrapped data.

In the following example, the column &resolution prints on the same line as the first line of the column &instructions:

print &phone	(+1,10) edit '(xxx) xxx-xxxx'
print &instructions (+1,10,30) wrap 6 30 keep-top
print &resolution	(0,+3,25)

The STRIP and ON arguments affect which characters are to be converted before wrapping, and which characters force a wrap to occur.

  • Characters in the STRIP string argument are converted to spaces before the wrap occurs.

  • Characters in the ON string argument cause a wrap at each ON character found. The ON character is not printed.

Both arguments accept regular characters and nondisplay characters for which decimal values are surrounded by angled brackets, <nn>, where nn is a decimal number between 1 and 255, representing the character in the current character set of the operating system. For example, to print a long data type that contains embedded carriage returns, the setup would be:

print  &long_field  (5,20)  wrap 42  30  on=<13>

The paragraph wraps at each carriage return, rather than at the usual word boundaries. If the ON character is not found within the width specified for the paragraph, the wrap occurs at a word space. The following example converts the STRIP characters to spaces before wrapping on either a line feed <10> or a space (the default):

print &description (20,10) wrap 50 22  strip=/\^@<13>  on=<10>

WRAP can also be used to print reversed characters, for support of languages such as Hebrew. An R after the length and max_lines arguments causes the field to be reversed before the wrap takes place. In addition, the entire paragraph is right-justified within the length indicated.

! Reverse wrap, in 30 character field.
print &comment (2,35) wrap 30 5 r
print $notes (1,50) wrap 50 7 r

LINE-HEIGHT specifies the number of lines to skip between each line of the wrapped data. By default, a value of 1 (single space) is assumed. The following example prints the comment column with one blank line between each printed line for a maximum of four printed lines:

print &comment (1,1) wrap 40 4 line-height = 2								! Double space text

See The LET command for information about copying, editing, or converting fields

See The ALTER-LOCALE command for a description of the arguments NUMBER-EDIT-MASK, MONEY-EDIT-MASK, and DATE-EDIT-MASK

See DISPLAY, SHOW