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>hpjustline()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
hpJustLine()

Extract a line of text from a character string or memo field


Syntax

hpJustLine(<cString> [, <nLength> [, <nLineNumber> [, <cUnits>]]])


Parameters

<cString>
The string or memo field to count.

<nLength>
The length of each line of text.  If using a fixed spaced
font, this value may be specified by number of
characters, inches or millimeters.  If using a
proportional font, this value must be specified in inches.
If omitted, <nLength> will default to the width of the page.

<nLineNumber>
The line number to extract from the character string,
provided that the wrapping is occuring with a line length
of <nLength>.

<cUnits>
The units of measurement to be used for the line length
parameter.  If <cUnits> is omitted, the units will default
to Rows and Columns.  Values for <cUnits> can be:
"R"     Rows and Columns
"I"     Inches
"M"     Millimeters


Returns

<c>
The line of text from <cString> specified by <nLineNumber>.

-10
Font information is missing.  hpSetFont( ) must be called first.

-17
Incorrect parameter type was passed.


Remarks

hpJustLine() is a replacement for Clipper's MEMOLINE() function.  It is
used in conjunction with hpJustCount() to fully justify memo fields or
strings using proportionally (or fixed) spaced fonts.

Because character widths vary for proportional fonts, word wrapping is
not accurate using Clipper's MEMOLINE() and MLCOUNT() functions.
But now, with hpJustLine() and hpJustCount(), wrapping and full
justification of proportional fonts is easy.  The concept behind using
these functions is to first count the number of lines there will be when
your string is fully justified.  Then use hpJustLine() to extract the lines
to be printed.


Support By

All HP Laserjet Printers


Example

To fully justify a memo field named MEMO, with a proportional font,
beginning at row 10, col 10, and a line length 6 inches:

hpConfig()
hpSetFont( 'HELV 12B', 'Z')
nRow        := 10
nStartCol   := 1
nLineLength := 6
nLines := hpJustCount( MEMO, nLineLength, "I")
FOR nLine := 1 TO nLines

See Also: hpWrap() hpJust() hpJustCount() hpMemoLine() hpMLCount()

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