This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||
|
4D v20 R8
Filter and format codes
|
Character | Meaning | Equivalent |
9 | Allow numbers | "0-9" |
a | Allow lowercase and uppercase | "a-z;A-Z" |
A | Allow uppercase | "A-Z" |
@ | Allow alphanumeric | "a-z;A-Z;0-9" |
The following entry filters are equivalent:
&9#
&"0-9"#
&"1;2;3;4;5;6;7;8;9;0"#
The following entry filters are equivalent:
&a#
&"a-z;A-Z"#
The following entry filters are equivalent:
&A#
&"A-Z"#
The number sign (#) is the only placeholder for Alpha filters and formats (other characters are available for Number filters and formats). You use one number sign for each character the user can enter in the field.
For example, the following entry filter allows the user to enter letters in four places:
&a####
The following entry filter allows the user to enter uppercase letters in three places, followed by numbers in two places:
&A###&9##
If you show no placeholders, the filter code allows any number of characters. The following entry filter allows the user to enter only numbers, but it does not limit the length of the entry:
&9
Note: You can set the maximum number of characters allowed in an Alpha field in the Structure editor (see 4D field types).
When a field with an entry filter is selected for data entry, 4D displays an underline (_) for each placeholder. As the user types a valid character, each underline is highlighted and replaced with the typed character.
You instruct 4D which character to substitute for the underline by beginning the entry filter with an exclamation point (!) and the character you want.
You can substitute any character for the underline. For example, if you display “XXXX” and the user types only two of the allowed characters (say they are “AA”), the field will contain “AAXX” when the record is saved.
The following illustration shows a selected field displaying underlines and zeros.
Any characters, punctuation marks, and spaces can be used as dead characters. Dead characters are displayed during data entry, but they are skipped over by the insertion point and are not entered as part of the data.
The characters you want to use as dead characters are placed before, after, and between placeholders. They are displayed during data entry for clarity.
The phone number entry filter (&9(###) ###-####) uses parentheses, a space, and a dash as dead characters. After you enter a digit immediately preceding a dead character, the insertion point moves directly to the first character following the dead character.
Product: 4D
Theme: Filters and formats
4D Design Reference ( 4D v20 R8)