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

Count the number of lines in a character string


Syntax

hpMLCount(<cString> [, <nLength> [, <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.

<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

hpMLCount() is a replacement for Clipper's MLCOUNT() function.  It is
used in conjunction with hpMemoLine() 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 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 wrapped.  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() hpMemoLine() hpJust() hpWrap()

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