Altair® Monarch®

 

Function: Len

Description

Returns the length of a string as a number.

Syntax

Len(string)

Arguments

string can be a constant, a character field, a memo field,an expression that results in a string or a function that returns a string.

Return value

This function returns a number representing the length of string.

Note: If string is a memo field, the return value accounts for a Carriage Return and Line Feed character at the end of each line, except for the last line. For example, a 5 line memo field with a template width of 20 will return a length of 108 (5 lines * 20 characters to account for the data in the field, plus 4 lines * 2 characters to account for the Carriage Return and Line Feed characters that Monarch Classic adds to all but the last line).

Calculated field example

If the City field contained the value Pittsfield or Chelmsford, the following calculated field expression would return 10: Len(City)

Note: Len(City) returns the actual length of the City field, not the length of the data in the field. If the field contains trailing spaces, use the RTrim function inside the Len function to first remove the trailing spaces, e.g.: Len(RTrim(City)).

Filter/Find example

Records with a blank Job_title field can be selected or found using the expression: Len(Job_title)=0 or len(RTrim(Job_title))=0