PrintSend – PB Docs 126

PrintSend PowerScript function

Description

Sends an arbitrary string of characters to the printer. PrintSend is
usually used for sending escape sequences that change the printer’s
setup.

note.png Obsolete function

PrintSend is an obsolete function and is
provided for backward compatibility only. The ability to use this
function is dependent upon the printer driver.

Syntax

Argument

Description

printjobnumber

The number the PrintOpen function
assigned to the print job.

string

A string you want to send to the printer.
In the string, use ASCII values for nonprinting characters.

zerochar
(optional)

An ASCII value (1 to 255) that you want
to use to represent the number zero in string.

Return Values

Integer. Returns 1 if it succeeds and
-1 if an error occurs. If any argument’s value is null, PrintSend returns null.

Usage

Use PrintSend to send escape sequences
to specific printers (for example, to set condensed mode or to set
margins). Escape sequences are printer specific.

As with any string, the number zero terminates the string argument.
If the printer code you want to send includes a zero, you can use
another character for zero in string and specify
the character that represents zero in zerochar.
The character you select should be a character you do not usually
use. When PowerBuilder sends the string to the printer it converts
the substitute character to a zero.

A typical print job, in which you want to make printer-specific
settings, might consist of the following function calls:

  1. PrintOpen

  2. PrintSend, to change the printer
    orientation, select a tray, and so on

  3. PrintDefineFont and PrintSetFont to
    specify fonts for the job

  4. Print to output job text

  5. PrintClose

Examples

This example opens a print job and sends an escape
sequence to a printer in IBM Proprinter mode to change the margins.
There is no need to designate a character to represent zero:

This example opens a print job and sends an escape
sequence to a printer in IBM Proprinter mode to change the margins.
The decimal ASCII code 255 represents zero:

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x