LINE

Top  Previous  Next

Syntax

 

1. line col1|{numexpr}, row1|{numexpr}, col2|{numexpr}, row2|{numexpr} [,thickness] [,color|lcolor colorname] [,rgb rrggbb]

 

2. line "text|!=text|~regexp|!~regexp[@left,top,right.bottom]", col1|{numexpr}, row1|{numexpr}, col2|{numexpr}, row2|{numexpr} [,thickness] [,color|lcolor colorname] [,rgb rrggbb]

 

Description

 

A line is drawn between the first column and row and the second column and row.  All dimensions can be specified to 2 decimal places, in the range of -255 to +255.  If used, numexpr is a Business Basic expression that generates a numeric value for the columns and rows.

 

If syntax 2 is used, then the line is drawn relative to any occurrence of the text, or of text that matches the regular expression regexpr.  In these cases, there may be no lines drawn, or several.  col1 and row1 are 0-based, in these formats, and can be negative if required, and col2 and row2 are the number or columns and rows to draw from the offset position. The search for text or regexpr can be limited to a region on the page by adding a suffix in the format '@left,top,right,bottom'.  To use a literal "@" character in text or regexpr, it is necessary to specify "\@".

 

If the syntax "!=text" or "!~regexpr" is used, then the search is for positions NOT equal to the text or NOT matching the regular expression.  When using the NOT syntax, only one search is performed per line in the search region.

 

The origin point of a line is the center of a cell.  In other words, position 1,1 is the center of the first character cell, 0.5,0.5 is the upper left corner of the cell, and 1,1 is the lower right corner of the cell.  This is consistent with the box command.

 

This positioning is different from version 7.0, requiring that column positions be shifted 0.5 columns left, and row positions be shifted 0.5 rows up.

 

Line Thickness

The optional thickness parameter may be a number from 1 to 99, indicating the number of dots or pixels to use when drawing the box outline.  The default thickness is 1 pixel.  UnForm always uses dots at 1/300 inch.  If a shade parameter is desired, then the thickness parameter is required.

 

 

Color

Color can be specified as "white", "cyan", "magenta", "yellow", "blue", "green", "red", or "black", or you can name an RGB value as a 6-character hex string with "rgb rrggbb", where rr is red (00-FF), gg is green (00-FF), and bb is blue (00-FF).

 

Examples

 

The following will draw a light green line from the upper left corner to the lower right corner of a page:

 

line 0.5, 0.5, 80.5, 66.5, 1, rgb 008000

 

The following will underline the word "TOTAL", in conjunction with a font command:

 

font "TOTAL:",0,0,5,1,cgtimes,12

line "TOTAL:", 0, .75, {textwidth("TOTAL:", "cgtimes",12,0)},0

 

 

Drivers: pcl, pdf, ps  (pcl cannot have –nohpgl enabled)