Entry Format

Specify a syntax string to define the entry format of the data entered into the field at run time.

ENT(SyntaxString)

Example: ENT(~@*)

Description

Uniface compares the format of the data in the field with the pattern specified in the syntax string. If the data does not match the specified pattern when the user leaves the field, Uniface returns an error and the user is prevented from leaving the field.

Syntax Codes

Syntax Codes for Pattern Matching
Syntax code Explanation
# One digit (0-9)
#* 0-n digits
& One letter (A-Z, a-z)
&* 0-n letters
@ One letter, digit, or underscore (_)
@* 0-n letters, digits, or underscores
Extended Characters. These are determined by the value of the $EXTENDED_SYNTAX assignment setting. Default is the full Unicode character set. For more information, see $EXTENDED_SYNTAX.
~& One extended letter.
~&* 0-n extended letters
~@ One extended letter, digit, or underscore (_)
~@* 0-n characters, extended letters, digits, or underscores

ASCII Characters

? One ASCII character
?* 0-n ASCII characters
A through Z That letter, in uppercase

a through z

That letter, in uppercase or lowercase
x The ASCII character x, except the syntax codes (#, *, &, @, ~, ?, (, ), %, and ^)
%x The ASCII character x, with no special meaning
(any) The syntax string (variable or constant) contained in parentheses is optional. A syntax check is done only if data is present.
%%^ Carriage return or line feed.

Note:  This code is allowed only to define entry formats in a field's syntax definition. It is not used in Proc pattern matching.

Examples

Examples of Entry Formats

Entry format

Allowed

Not allowed

#*

1000

[nothing]

12

12314567

1,000

0000.0

34 456

10A

?*%*

Any text with an asterisk (*) as the last character.

Text without an asterisk as the last character.

#*.##

1000.00

0.50

.50

10.53

1,000.00

0.5

0.510

1000,50

Mr. Smith

MR. SMITH

Mr. Smith

MR. Smith

Mr. SMitH

mr. smith

Mr.Smith

MR. Smith

Mr. Jones

(###) ###-####

404 396-3040

396-3040

(404) 396-3040

41 396-3040

396 3040

%(###%) ###-####

(404) 396-3040

404 396-3040

396-3040

(404)396-3040

@*

Smith1

Smith_Jones

12345X2

Smith?

Mr. Smith

12345*2

# ##-&

1 23-a

123-a

1 23-a

1 23 - a

#*?##

123,45

0.30

a30

121/33

12345

.3

,300

123.300

%#

#

Anything else

(J)(N)(.)

J

N

.

Anything else