| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== LEN (return length of string) ====== | [[left return left justified string .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[line draw a straight line .htm|{{btn_next_n.gif|Next page}}]] | | || **LEN(**//string//**)** {{blk2blue.jpg|blk2blue.jpg}} | **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**