Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Escape! V3.0 - <b>hpicenter()*</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
hpICenter()*

Center a string horizontally on the page with coordinates specified in inches


Syntax

hpICenter(<cString> [,<nRow> [,<nCol>]])


Parameters

<cString>
The character string to be centered.

<nRow>
The vertical distance from the top margin to print the
specified string.  <nRow> is specified in inches.  If is
omitted, Escape! will print the string at the current row.

<nCol>
The position where the string is to be centered at.
<nCol> is specified in inches.  If omitted, <nCol> will
default to the center of your page regardless of what
size paper you are using.


Returns

0
Successful.

-10
ESC_FONT was not initialized, or was released.

-12
Wrong number of parameters passed.


Remarks

hpICenter() is included for compatibility with earlier versions of Escape!.
The use of hpICenter() is not recomended because it can be functionally
replaced by hpCenter() with 'I' (for Inches) passed as the <cUnits>
parameter.

hpICenter() is very useful for centering titles and page numbers
especially when working with proportional fonts.


Support By

All HP Laserjet Printers


Example

hpConfig()
hpSetFont('HELV 10B', 'U')
nLine := 1
nPg   := 1

* center the title and subtitle at top of page
hpICenter('Title', hpL2I(nLine))
hpICenter('Subtitle', hpL2I(nLine+1))

* center page number 10 inches down
hpICenter('Page '+STR(nPg,2), 10)

If you need the center of a string to be positioned exactly 3 inches from
the top of the page, and 4 inches from the left edge of the page:

hpICenter('String', 3, 4)

hpICenter() can even be combined with Escape!'s other functions:

hpICenter(hpBold('Centered and Bold'))
hpICenter(hpUnderln('Centered and underlined'), 1)

See Also: hpCenter() hpIRJust() hpRJust()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson