ID: Q94812
The information in this article applies to:
The TXTWIDTH() function determines the width of a character expression in the font selected for the active output window. The calculation returns the width in pixels.
The syntax of the TXTWIDTH() function is as follows
TXTWIDTH(<expC1>[,<expC2>,<expN1>[,<expC3>]])
where:
This example directs output to the main FoxPro window and determines the width of the string "HELLO" in the current output font:
ACTIVATE SCREEN
? TXTWIDTH("HELLO")
This example directs output to the main FoxPro window and determines
the width of the string "HELLO" in 14-point Roman font:
ACTIVATE SCREEN
? TXTWIDTH("HELLO","Roman",14)
This example directs output to the main FoxPro window and determines
the width of the string "HELLO" in 14-point bold italic Roman font:
ACTIVATE SCREEN
? TXTWIDTH("HELLO","Roman",14,"BI")
Additional reference words: FoxWin 2.50 2.50a
KBCategory: kbprg
KBSubcategory: FxprgGeneral
Last Reviewed: June 27, 1995