Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

PrintText – PB Docs 2021 – PowerBuilder Library

PrintText – PB Docs 2021

PrintText

PowerScript function

Description

Prints a single line of text starting at the specified
coordinates.

Syntax

Argument

Description

printjobnumber

The number the PrintOpen function assigned to the print
job.

string

A string whose value is the text you want to print.

x

An integer specifying the x coordinate in thousandths of
an inch of the beginning of the text.

y

An integer specifying the y coordinate in thousandths of
an inch of the beginning of the text.

fontnumber (optional)

The number (1 to 8) of a font defined for the job by using
the PrintDefineFont function or 0 (the default font for the
printer). If you omit fontnumber, the text prints in the current
font for the print job.

Return value

Integer. Returns the x coordinate of the new cursor location (that
is, the value of the parameter x plus the width of the text) if it
succeeds. PrintText returns -1 if an error occurs. If any argument’s value
is null, PrintText returns null.

Usage

PrintText does change the position of the print cursor, unlike the
other print functions for which you specify coordinates. The print cursor
moves to the end of the printed text. PrintText also returns the x
coordinate of the print cursor. You can use the return value to determine
where to begin printing additional text.

PrintText does not change the print cursor’s y coordinate, which is
its vertical position on the page.

Examples

These statements start a new print job and then print PowerBuilder
in the current font 3.7 inches from the left edge at the top of the page
(location 3700,10):

The following statements define a new blank page and then print
Confidential in bold (as defined for font number 3), centered at the top
of the page:

This example prints four lines of text in the middle of the page.
The coordinates for PrintText establish a new vertical position for the
print cursor, which the subsequent Print functions use and increment. The
first Print function uses the x coordinate returned by PrintText to
continue the first line. The rest of the Print functions print additional
lines of text, after tabbing to the x coordinate used initially by
PrintText. In this example, each Print function increments the y
coordinate so that the following Print function starts a new line:

See also

Print

PrintClose

PrintOpen


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