Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?

LEN

Description

The LEN function returns the character length of the supplied expression. It takes the general form: 

LEN(expression)

Where expression can evaluate to any type and the function will convert it to a string automatically.

The LEN() function when used in International Mode will return the number of characters in the specified expression rather than the number of bytes. If the expression consists entirely of UTF-8 characters in the ASCII range 0 – 127 then the character length of the expression will equate to the byte length. However, when the expression contains characters outside the ASCII range 0 – 127 then byte length and character length will differ.


Note: 

If the byte is specifically required then it is recommended that the BYTELEN function be used in place of the LEN function. It is also not recommended to use programs manipulating byte counts in International Mode.

An example of use may be as: 

VAL = "qwerty"
CRT LEN(VAL)

to display 6


Go back to jBASE BASIC.

Was this article helpful?