LEN (return length of string)

Top  Previous  Next

 

LEN(string)

LEN

Returns length of a string.

string

A string constant, variable, or expression.

The LEN procedure returns the length of a string. If the string parameter is the label of a STRING variable, the procedure will return the declared length of the variable. If the string parameter is the label of a CSTRING or PSTRING variable, the procedure will return the length of the contents of the variable. Numeric variables are automatically converted to STRING intermediate values.

Return Data Type:

UNSIGNED

Example:

IF LEN(CLIP(Title) & ' ' & CLIP(First) & ' ' & CLIP(Last)) > 30 !If full name won't fit

Rpt:Name = CLIP(Title) & ' ' & SUB(First,1,1) & '. ' & Last    !use first initial

ELSE

Rpt:Name = CLIP(Title) & ' ' & CLIP(First) & ' ' & CLIP(Last)  !else use full name

END

 

Rpt:Title = CENTER(Cus:Name,LEN(Rpt:Title))               !Center the name in the title