7.4

Table Of Contents
String value whose width is returned.
Code Sample Example
This example draws a tight box around a variable length data selection.
Example
margin(0,0)
%Define the data. This could be a data selection.
define(&data,string,'This is a sample string')
set(&data,trimright(&data))
%Store the length
define(&dw,measure,stringwidth(&data))
moveto(1,1)
%Display the string, then draw a box around it.
show(&data)
rectstroke(1,0.86,&dw,0.2)
StringWidthUTF8 (function)
Returns the length, in inches, of the string as it would be displayed on a page, using the current font. Bear in mind that the com-
bination of many bytes sometimes results in a single glyph and that text orientation can also affect the number of glyphs dis-
played.
Syntax
stringwidthutf8(text, mode)
Arguments
text
UTF8 text string to be measured.
mode
String specifying how the contextual analysis is to be performed. Possible values are 'normal', 'reverse', and 'none' (for no con-
textual analysis).
StrToFloat (function)
Converts a string into a measure value.
Syntax
strtofloat( string ) measure value
©2010 Objectif Lune Inc - 538 -