PRINT-BAR-CODE
Syntax
PRINT-BAR-CODE position {TYPE={bar_code_type_num_lit|_var|_col}} {HEIGHT={bar_code_height_num_lit|_var|_col}} {TEXT={bar_code_txt_lit|_var|_col}} [CAPTION={bar_code_caption_txt_lit|_var|_col}] [CHECKSUM={checksum_lit}]
Description
Prints industry standard bar codes. SQR supports the bar code types listed in the following table.
| Type | Description | Text Length | Text Type | CHECKSUM RECOGNIZED |
|---|---|---|---|---|
|
1 |
UPC-A |
11, 13, or 16 |
9 |
|
|
2 |
UPC-E |
11, 13, or 16 |
9 |
|
|
3 |
EAN/JAN-13 |
12, 14, or 17 |
9 |
|
|
4 |
EAN/JAN-8 |
7, 9, or 12 |
9 |
|
|
5 |
3 of 9 (Code 39) |
1 to 30 |
9, X, p |
y |
|
6 |
Extended 3 of 9 |
1 to 30 |
9, X, x, p, c |
y |
|
7 |
Interleaved 2 of 5 |
2 to 30 |
9 |
y |
|
8 |
Code 128 |
1 to 30 |
9, X, x, p, c |
|
|
9 |
Codabar |
1 to 30 |
9 |
y |
|
10 |
Zip+4 Postnet |
5, 9, or 11 |
9 |
|
|
11 |
MSI Plessey |
1 to 30 |
9 |
y |
|
12 |
Code 93 |
1 to 30 |
9, X, p |
y |
|
13 |
Extended 93 |
1 to 30 |
9, X, x, p |
y |
|
14 |
UCC-128 |
19 |
9 |
|
|
15 |
HIBC |
1 to 30 |
9 |
y |
Parameters
| Parameter | Description |
|---|---|
|
position |
Specifies the position of the upper left corner. Position parameters can be relative. See the POSITION command for examples of relative positioning. Document markers are not allowed. After the statement executes, the current position is returned to this location; however, the next listing line is the next line below the bottom of the bar code. (This is different from the way the PRINT command works.) |
|
TYPE |
Specifies the type of bar code to be printed. Types are shown in the Bar Code Types table. |
|
HEIGHT |
Specifies the height of the bar code in inches. The height must be between 0.1 and 2 inches. The code prints to the nearest one-tenth of an inch. For Zip+4 Postnet, the height of the bar code is fixed. The height should be between 0.2 and 2.0 for Zip+4 Postnet. If it is less than 0.2, the bar code extends above the position specified. |
|
TEXT |
Specifies the text to be encoded and printed. The number and type of text characters permitted or required depends on the bar code type. See the Bar Code Types table for specifications. |
|
CAPTION |
Specifies optional text to be printed under the bar code in the current font. SQR attempts to center the caption under the bar code; however, for proportional fonts this may vary slightly. CAPTION is not valid for Zip+4 Postnet. If specified, it is ignored. |
|
CHECKSUM |
Specifies an optional check sum to be computed and printed within the bar code. Valid values are YES and NO, where NO is the default. Note: Some barcode types ignore the CHECKSUM qualifier. See the Bar Code Types table for those barcode types for which CHECKSUM is relevant. |
Example
This example shows how to use the PRINT-BAR-CODE command to create a UPC-A bar code:
begin-program
print 'Sample UPC-A Barcode' (1,1)
print-bar-code (3,1)
type=1 ! UPC-A
height=0.3
text='01234567890'
caption='0 12345 67890'
end-program
This example shows how to use the PRINT-BAR-CODE command to create a ZIP+4 Postnet code:
begin-program
print 'Sample Zip+4 Postnet' (1,1)
print 'John Q. Public' (3,1)
print '1234 Main Street' (4,1)
print 'AnyTown, USA 12345-6789' (5,1)
print-bar-code (7,1)
type=10
height=0.2
text='12345678934'
end-program
Note:
SQR does not check bar code syntax. See your bar code documentation for the proper formatting of certain bar codes.