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

Determine length of string in inches


Syntax

hpS2I(<cString>)


Parameters

<cString>
The text that is to be measured.


Returns

<n>
Length of string in inches.

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

-12
Wrong number of parameters passed.


Remarks

Using proportional fonts can be difficult, but hpS2I() makes certain tasks
much easier.  Surrounding a proportional string of unknown length with
a box would be almost impossible without it, with it is easy as the
examples show.


Support By

All HP Laserjet Printers


Example

cText = 'This should be surrounded by a box'
hpIAtSay(1, 1, cText)
****
* surround with 1/4' margin on all four sides
****
hpIBox(.75, .75, 1.25, 1+hpS2I(cText)+.25, 1)
cText = 'This should be highlighted with gray bar'
hpIAtSay(2, 1, cText)
hpIGrayBar(2, 1, hpS2I(cText), 0, 10)

See Also: hpC2I() hpL2I()

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