PrintWidth PowerScript function
Description
Determines the width of a string using the current font of
the specified print job.
Syntax
|
1 |
<span>PrintWidth</span> ( <span>printjobnumber</span>, <span>string</span> ) |
|
Argument |
Description |
|---|---|
|
printjobnumber |
The number the PrintOpen function |
|
string |
A string whose value is the text for |
Return Values
Integer. Returns the width of string in
thousandths of an inch using the current font of printjobnumber if
it succeeds and -1 if an error occurs. If any argument’s
value is null, PrintWidth returns null.
If the returned width exceeds the maximum integer limit (+32767), PrintWidth returns
-1.
Examples
These statements define a new blank page and then
set W to the length of the string PowerBuilder in
the current font and then use the length to position the next text
line:
|
1 |
long Job |
|
1 |
int W |
|
1 |
|
1 |
// Start a new print job. |
|
1 |
Job = PrintOpen() |
|
1 |
|
1 |
// Determine the width of the text. |
|
1 |
W = <span>PrintWidth</span>(Job,"PowerBuilder") |
|
1 |
|
1 |
// Use the width to get the next print position. |
|
1 |
Print(Job, W - 500, "Features List") |
See Also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest