Application icon

Prompt Text Format Codes

The Prompt For Text and Prompt from Container statements can validate entered values. The Prompt for Text statement can also automatically apply post processing when closing the panel. If the specified requirements are not met, the panel will not be closed. The requirements are specified in the named variable Prompt for Text Formatting. Starting with Yate v6.6, these values may be pre-configured by clicking on the Prompt For Text statement's button with the gear icon. The validation and post processing codes may also be specified in the Prompt from Container statement's validate key.


Validation Codes

The following codes are processed by Prompt For Text and Prompt from Container statements when attempting to close the panels. With the exception of the N code, they are ignored by the Prompt For Text statement's multi line editor.

E (May not be visually empty)
Require that the value entered is not visually empty.

N (Newline characters are invalid)
Require that the value entered does not contain any newline characters. When editing in the multi line editor, newline characters will not be accepted.

!
This code is only processed by a Prompt from Container statement. Typically values which are read only are not validated. If this code is present, read only values will be validated. One possible use is that you have a read only field which has a get folder or file path control. When first displaying the panel, the field may be empty as you have not yet set a path. You might want to disallow empty.

~
This code is only processed by a Prompt from Container statement. If a value is empty and the cell has a placeholder, validation will always succeed regardless of the other codes.

# (Require an integer value)
The value entered must be a valid integer.

#lower limit (Require an integer value - range)
The value entered must be an integer value greater or equal to the specified lower limit. eg. #0

#lower limit,upper limit (Require an integer value - range)
The value entered must be an integer value greater or equal to the specified lower limit and less or equal to the specified upper limit. eg. #0,5

$ (Require a numeric value)
The value entered must be a valid number.

$lower limit (Require a numeric value - range)
The value entered must be a numeric value greater or equal to the specified lower limit. eg. $0.1

$lower limit,upper limit (Require a numeric value - range)
The value entered must be a numeric value greater or equal to the specified lower limit and less or equal to the specified upper limit. eg. #0.1,5.5

I (Invalid characters)
All characters following the I are treated as invalid characters. The characters are case sensitive. No additional codes will be processed after I. This is the only position dependent format sequence.

P
The sequence must be a path specification starting with / or ~/. Note that other than testing for the presence of one of the two valid prefixes, no other validation of the path is performed.

F
The value must be a path to an existing file.

D
The value must be a path to an existing folder.

Note that only one of the P F D # $ codes will be processed. The precedence order is the displayed order. ie. P overrides all others, F overrides D # $, etc.


Post Processing Codes

The following codes are processed by the Prompt For Text (single and multi line editor) and the Prompt from Container statements. They are applied when the panel is closed.

T (Trim - Spaces)
The value returned has all leading and trailing spaces and tabs removed.

W (Trim - Spaces and Newline)
The value returned has all leading and trailing spaces, tabs and newline characters removed.

S (Compress space sequences)
All sequences of multiple spaces and tabs are replaced by a single space.

Visibility Codes

The following codes are processed by Prompt For Text (single and multi line editor).

R (Read only text field)
This code will cause the text field and multi line text editor to be read-only.

Prior to v6.5 of Yate, a Prompt for Text List R/O named variable would have the same effect if set to a non zero value. Use of this named variable is now deprecated. Staring with v6.5, Prompt for Text List R/O is only examined if an R code is not present. Use of Prompt for Text List R/O is now deprecated.

H (Hide text field)
This code will cause the text field and multi line text editor to be hidden.

C (Display spaces as centered dots)
Causes spaces to be displayed as centered dot characters.

Menu Insertion Modes

The following codes are processed by Prompt For Text (single and multi line editor).

X (Menu item insertion mode - Overwrite)
Typically when a value is chosen by the picker menu, the insertion mode is controlled by the read only setting R When read only, the chosen value overwrites the entire field. When not read only the chosen value overwrites selected text or is appended to the field. You can force chosen values to always overwrite by specifying the X code.

A (Menu item insertion mode - Insert/Append)
Forces items chosen by the picker menu to be added separated by a delimiter. The delimiter is specified in the Prompt for Text Append Delimiter named variable. If the named variable is empty, a comma is assumed.

Prior to v6.5 of Yate, setting the named variable Prompt for Text List Overwrite to a positive integer value would imply an X code. Setting it to a negative integer would imply an A code. Starting with v6.5, the named variable Prompt for Text List Overwrite is only examined if Prompt for Text Formatting does not contain an X or A code. Use of Prompt for Text List Overwrite is now deprecated. If an X and A code are present, the code specified last will be in effect.

If an X and A code are present, the code specified last will be in effect.