Export (0) Print
Expand All
Expand Minimize

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.

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

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)

Community Additions

ADD
Show:
© 2014 Microsoft