Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check the length of a text string
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00160649
Message ID:
00160698
Views:
17
>The LEN() command will tell you how many characters there are, but I don't think that will help too much unless you're using truetype fonts - where all the characters take up the same abount of space.

TrueType(tm) fonts do not necessarily take up the same amount of space! They use a common method of encoding the font so that it's easily sized and adapted to a wide range of graphic devices through a common interface.

The choice here is between monospaced and proportional fonts. With monospaced fonts, each character occupies the same amount of horitzontal and vertical space; proportional fonts adjust their width according to the character definition.

>
>>I seem to be having a problem calculating the length of a text string. I tried the txtwidth() function and and fontmetric() function as shown in the txtwidth() help examle and I am getting nowhere. All I want to do is find the lenght of a string so I can auto size the box or command button it appears in.
>>
>>As usual, many thanks to all who help.
>>
>>John J. Henn.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform