Skip to content

Length Command

Obsolete

This command is replaced by the Length function.

See Also

Purpose

To move the number of characters in a value to a variable.

Syntax

length
value
to
variable

What It Does

The length command counts the number of characters, including embedded spaces, in value and puts the result in variable.

The way it deals with leading and trailing spaces varies according to the class of value:

  • For database fields, length returns the defined length of the field.
  • For constants, length returns all characters, including all spaces, between the quotation marks.
  • For windows, length returns all characters, including leading spaces, except for trailing spaces.
  • For variables, length returns whatever was moved to the variable (see rules above for the possible sources of data in any variable). length does not return the defined length of the variable unless it is full of characters, as all String type variables are immediately after being declared (they are full of spaces).

Example

string riches
number digits
move "great, vast " to riches
length riches to digits

In this example, the string "great, vast " (with one trailing space) is moved to the String-type variable riches. The length command would put a value of 12 into digits.

Notes

  • Although length can be used on Date-, Integer-, and Number-type variables, it is typically used on String-type variables.