gDipMeasureSting is certainly preferable to txtwidth, but, in my experience, it is not as precise as advertised.
In my routines that use it, I've included a fudge-factor multiplier to adjust as necessary for my actual output.
IIRC, I've had to fudge by as much as 7% in some cases.
Also, I should add that one place I use it is in conjunction with the old GenRepoX trick of preprocessing
the FRX. So, for example, MAX(gdipmeasurestring) can be used to set the width of a report
object before proceeding with actual output -- with the obvious trade-off of the
preprocessing time involved.
-m.
****************
>
http://doughennig.blogspot.no/2006/04/forget-txtwidth-use-gdipmeasurestring.html>
>>Hi All:
>>
>>I have a character field on my report that could potentially be as wide as 20 characters. In 90% of the cases, however, the field is less than 12 characters. Since I want the field to display as large as possible, I want to place two fields on the report with code in the 'print when', so that if it is less than 12 characters, use the larger font.
>>
>>However, since I'm dealing with the Arial font, I can't say len>12, since a 'W' is wider than an 'i'. What is the code I would use?
>>
>>Thanks,
>>
>>Yossi