maxLength

Type: Integer

Availability: Read or write at any time

The maxLength property contains the maximum length of text that can be entered into a TextBox control or the text box portion of a ComboBox control, to limit the text entry. (For details about automatically moving focus to the next control in the tab order of a form when a user enters the final character into a text box at the maximum text position, see the TextBox class autoTab property.)

For a Table control, the maxLength property contains the amount of text that can be entered into a cell that has the inputType property set to InputType_TextBox (2), InputType_TextNumeric (4), or InputType_SignedNumeric (6).

The Table control accessMode, accessedSheet, accessedRow, accessedColumn, or accessedCell property determines whether the maxLength property for the current sheet, cell, column, or row is being accessed.

The settings of the maxLength property are listed in the following table.

Value Description
0 No limit on how much text can be entered except for the limit imposed by Windows
n Maximum number of characters that can be entered in the text box

Setting the value of the maxLength property for a text box control is rejected when the dataType property of a text box control is set to a numeric type when the current text in the text box does not conform to the rules defined by the current dataType, decimals, and maxLength properties.

The limit is not imposed on changes to the text made by logic.

Extra room should be assigned for a text box when the dataType property allows decimals (for the '.' character) and a signed numeric (for the '-' sign).

An Enter key press counts as two characters.

The maxLength property of the JadeRichText control contains the maximum number of characters, including spaces, that can be entered or pasted into the control. The default value of zero (0) indicates a pre-imposed limit of 65,534 for the maximum number of characters that can be entered or pasted. (Note that an embedded object counts as one character long.)

JadeRichText controls can contain formatted data and embedded content making it expensive to check whether the amount of data exceeds the value of the maxLength property for large amounts of text.

A value of the maxLength property less than or equal to 256 limits is an absolute limit.

A value of the maxLength property greater than 256 is only an approximate limit. To avoid making an assignment to a fixed-length String attribute that raises a 1035 "String too long" exception, first determine the length of the string, as shown in the following code fragment.

num := jadeRichText.text.length;