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

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


Syntax

hpMemoLine(<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

hpMemoLine() is a replacement for Clipper's MEMOLINE() function.  It is
used in conjunction with hpMLCount() to wrap 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 hpMemoLine() and hpMLCount(), wrapping and 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 hpMemoLine() to extract the lines to be printed.


Support By

All HP Laserjet Printers


Example

To wrap 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 := hpMLCount( MEMO, nLineLength, "I")
FOR nLine = 1 TO nLines

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

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