PrintWidth
PowerScript function
Description
Determines the width of a string using the current font of the
specified print job.
Syntax
|
1 |
PrintWidth ( printjobnumber, string ) |
|
Argument |
Description |
|---|---|
|
printjobnumber |
The number the PrintOpen function assigned to the print |
|
string |
A string whose value is the text for which you want to |
Return value
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 2 3 4 5 6 7 8 9 10 11 |
long Job int W // Start a new print job. Job = PrintOpen() // Determine the width of the text. W = PrintWidth(Job,"PowerBuilder") // Use the width to get the next print position. Print(Job, W - 500, "Features List") |
See also