Navigation:  Reference > Functions >

TextWidth()

Print this Topic Previous pageReturn to chapter overviewNext page

 

TEXT_WIDTH(1,2,3)

 

PURPOSE

This function will return the approximate size of a specified string in pixels.

 

PARTS

1 f/c/eThe string to use.  If you don't specify a value here you must give the number of characters in part 2.

 

2 f/c/eThe number of characters in the string.  If you don't specify a string in part 1 then this is required.

 

3 f/c/eIf you don't specify a string in part 1 this is the character that will be used internally to make up the string.  If you don't specify a value here the program will automatically use the letter 'X'.

 

RETURN TYPE - I

This will be the approximate number of pixels the string will take to display in its entirety on your monitor.

 

COMMENTS

This function uses the font of the current form.  If the object you're testing this for uses a different font, or if you change the font on the form at some later time, the value previously returned will probably be incorrect.  Also, this is only a approximation.  If the user enters a series of Cs or other large character the number of pixels returned by this function may not be enough unless you used that same string in part 1.

 

This is not a widely used function but we use something similar in trying to approximate the size of entry or printing fields when you're designing your forms or reports.

 

 


Page url: http://www.cassoftware.com/tas/manual/textwidth().htm