LEN( ) Function

Determines the number of characters in a character expression, indicating the length of the expression.

LEN(cExpression)

Parameters

  • cExpression
    Specifies the character expression for which LEN( ) returns the number of characters.

Return Value

Numeric. LEN( ) returns the number of characters in a character expression.

Example

The following example clears the main Visual FoxPro window using the CLEAR command and opens the Customer table in the sample Testdata database located in the Visual FoxPro ..\Samples\Data directory by using the OPEN DATABASE and USE commands. Combined with the ? and ?? commands, LEN( ) displays the number of characters in the fields, Cust_ID and Contact.

CLEAR
OPEN DATABASE (HOME(2) + 'Data\testdata')
USE Customer     
? 'Width of contact field: '
?? LEN(contact)
? 'Width of cust_id field: '
?? LEN(cust_id)

See Also

Reference

FSIZE( ) Function

TXTWIDTH( ) Function

LENC( ) Function

Other Resources

Functions

Language Reference (Visual FoxPro)