Field WdgCol

The horizontal position of the left edge of the object, expressed in twips.

Required: Either Col (characters) or WdgCol (twips) must be specified

Valid Values

A number (longint)

Remarks

In DisplayForms, indicates the horizontal position of the left edge of the first occurrence of the form in relation to the display.

In FormFields, indicates the horizontal position of the left edge of the form field in relation to its parent object (form field, form, menu).

In Menus, indicates the horizontal position of the left edge of the menu in relation to the window.

In Windows, indicates the horizontal position of the left edge of the window. For a pop-up window, this position is relative to the screen; for a clipped window, this position is relative to its parent window’s client area.

See Also

Col, WdgClass, WdgRow

Field WdgRow

The vertical position of the top edge of the object, expressed in twips.

Valid Values

A non-negative number (longint)

Remarks

In DisplayForms, indicates the vertical position of the top edge of the first occurrence of a repeated form in relation to the display.

In FormFields, indicates the vertical position of the top edge of the form field in relation to the form field’s parent object (form or other form field, or menu or other menu item).

In Menus, indicates the vertical position of the top edge of the menu in relation to the screen. Applies only to menus of the Pop-up class.

In Windows, indicates the vertical position of the top edge of the window. For a pop-up window, this position is relative to the screen; for a clipped window, this position is relative to its parent window’s client area.

It is required when either Row (characters) or WdgRow (twips) must be specified

See Also

Row, WdgClass, WdgCol

Field DirName

The name of an application directory (Directories); otherwise, the one application directory in which the associated object may exist.

Valid Values

An 18-character string, containing a valid object name

Remarks

In Directories:

DirName is the name assigned to the directory.

In other Object Dictionary entity sets:

In any entity set, the principal object’s DirName must match the DirName of its owner.

If DirName is left blank, the object may exist in any number of application directories.

In DDDescriptions, DirName is where the object being described may be found.

In DisplayForms, DirName is where the owner-display of the associated form may be found.

See Also

ConstName, DDObjectName, DDOwnerName, DisplayName, DocName, EntName, FieldName, FormName, MenuName, OwnerName, RelName, RoleName, SetName, UserName, VarName

Field ValRule

The validation rule for a form field.

Entry fields: Sets out a validation rule against which data entered into an entry form field is to be tested.

Toggle form fields or menu items: Sets out a validation rule which activates the “on” state of the field or item if its value is valid.

Valid Values

A 256-character string, containing the validation rule

Remarks

The format of the validation rule depends on the data type (DT) of the form field. For more information, see the discussion below.

HOW TO USE THE “VALIDATION RULE” ATTRIBUTE

Zim uses the validation rule to check that all data entered into the form field conforms to a pre-determined pattern. How a validation rule is constructed depends on whether the form field’s data type is alphanumeric, non-digit, date, or numeric/calculator.

Alphanumeric/Non-Digit Validation Rules

Table below shows how to construct a validation rule for an alphanumeric or non-digit form field. The next table shows some examples of validation rules, together with some legal and illegal data values for each.

How to Construct Validation Rules for Alphanumeric or Non-Digit Form Fields

CHARACTER CODE

APPLICATION

Pattern Matching

A

Can be replaced by any letter (A to Z, a to z).

X

Can be replaced by any letter or digit (A to Z, a to z, 0 to 9).

9

Can be replaced by any digit (0 to 9).

Z

Can be replaced by any digit or blank (0 to 9, and space character).

Any other character or digit in a pattern must be replaced by the identical character or digit. The “escape” character (backslash–) can be used in front of any of the above characters when you want to use that character literally (i.e., to use the Z as the letter “Z” instead of as a pattern matching symbol for blanks and digits).

CHARACTER CODE

APPLICATION

Syntax

[ ]

Encloses a set of alternate characters. (Note: all characters used inside square brackets are taken literally, that is “A” is the letter A, not the pattern matching symbol “A” used to indicate any letter.)

Used inside square brackets (“[” and “]”) to denote a range of characters, for example, [B-F] would mean any of B, C, D, E, or F.

|

The “or” bar separates alternative validation patterns, for example, C|D would mean either C or D.

 

An Alphanumeric Validation Example: Telephone Numbers

A good example of the flexibility of the “validation rule” attribute is the validation of North American telephone numbers. The telephone numbers may or may not have a preceding area code. Suppose that telephone numbers have the property that the first digit of an area code may only be between 2 and 9. The second digit may only be a 0 or a 1 and the first and second digit of the exchange number may only be between 2 and 9.

When defining an alphanumeric form field to hold such a telephone number, the alphanumeric validation rule is a combination of two patterns:

[2-9][0-1]9-[2-9][2-9]9-9999|[2-9][2-9]9-9999

therefore:

212-643-9763    is legal from first pattern.

222-643-9763    is illegal.

643-9763        is legal from second pattern.

143-9763        is illegal.

Numeric/Calculator Validation Rules

Table below shows how to construct validation rules for numeric or calculator form fields. Next table  shows some examples of numeric validation rules, explaining the values that are legal for each.

Date Validation Rules

Form fields of data type date may be assigned a validation rule that describes the acceptable range of dates. The format of the validation pattern is the same as that used for numeric form fields, but the numbers must be legitimate date values. For example, the rule:

19920101-19921231

means that any date in the year 1992 is acceptable.

Examples of Alphanumeric Validation Patterns

VALIDATION RULE

LEGAL VALUES

ILLEGAL VALUES

AB

qB

q”

 

AB

q

 

LB

7B

 

BB

B8

XX-XXXX

AL-9632

$63.09

Q[L-P]A

QLA

QRA

 

QMA

qLa

 

QPA

QPB

[ACEG]

A

B

 

C

D

 

E

F

[Ax-zB]

A

a

 

y

Y

 

B

b

A|9

m

?

 

3

$

 

Q

%

Y|N

Y

A

 

N

5

 

How to Construct Validation Rules for Numeric Form Fields

RULES FOR CREATING NUMERIC VALIDATION RULE PATTERNS

1.  The pattern may specify one or more numbers, or ranges of numbers, that the value in the form field must satisfy.

2.  Numbers may include digits (0-9), the decimal point, and the plus (+) and minus (-) signs (e.g., -12, 2.141).

3.  Ranges are two numbers linked by a hyphen (e.g., 1-9, 1.45-1.46).

4.  Numbers and ranges may be specified together. Use the logical “or” bar (|) to separate one item from the next (e.g., 1|2|5-9).

Examples of Numeric Validation Patterns

VALIDATION RULE

MEANING

1|2|3|5

The only legal values that may be entered are 1, 2, 3, or 5.

10-20

Legal values range from 10 to 20 inclusive. 10.123 is also a legal value.

10-20|100-200

Legal values lie in the range of 10 to 20 or 100 to 200.

-30–5|1|1.3-1.7

Legal values are between -30 and -5, or 1, or between 1.3 and 1.7.

FThe DataMask attribute can be used to control the number of decimal places allowed in a numeric or calculator form field.

Using a Validation Rule to Switch a Toggle Form Field “On”

In the absence of a ValRule, a toggle form field is set to the “on” state whenever its current data value exactly matches its WdgOnValue. However, by setting a ValRule, you can provide many alternative values for the “on” state.

Consider Figure 3.1.

Enter favorite food: ice cream

Figure 3.1: Setting a toggle button with a validation rule.

The end-user has typed “ice cream” into the entry field. (Assume that the field forces lowercase input, because validation rules are case-sensitive.) Also assume that the application program assigns “ice cream” to the option button box and executes a FORM DISPLAY command. The option button box checks “ice cream” against the ValRules of its option buttons; the “Dairy” button is therefore set “on”, and all other buttons, “off”.

See Also

DataMask, DT, FT, VA, VR, WdgInputMask, WdgOnValid Values

Field WdgStyle

The “style” of the particular class and subclass of an object.

Valid Values

An integer code as shown in the tables that follow.

For FormFields

Code

Meaning

“Label” class

1

Text

“Text-entry” class

1

Edit control

“Toggle button” class

1

Check box (square)

2

Radio button (circle)

3

Bitmap (*.bmp files in some windowing environments)

4

Metafile (*.wmf files in some windowing environments)

5

Icon (*.ico files in some windowing environments)

“Push button” class

1

Push button

3

Bitmap (*.bmp files in some windowing environments)

4

Metafile (*.wmf files in some windowing environments)

5

Icon (*.ico files in some windowing environments)

“Menu item” class

1

Text

“Frame” class

1

Standard

“List box” class

1

Always-dropped list

2

Drop-down list

“Combo box” class

1

Always-dropped combo box

2

Drop-down combo box

“Option button group” class

1

Standard

“Image box” class

1

Bit map

2

Icon

3

Metafile

“Graphic” class

1

Line (horizontal)

2

Rectangle

3

Ellipse (or circle)

4

Diamond

5

Rounded rectangle

6

Line (vertical)

7

Negative slope line

8

Positive slope line

“Divider” class

1

Single line

“User message” class

1

Plain text

For Windows

Code

Meaning

0

Borderless

1

Simple

2

Dialog

3

Resizeable

For Menus

Currently unused.

Remarks

Only resizable windows can have menus.

See Also

FT, WdgClass, WdgSubClass

Field WdgSubClass

A code indicating the “subclass” (subtype) of the associated object.

Valid Values

An integer code, as shown in the tables that follow.

For FormFields

Code

Meaning

“Label” class

1

Static

2

Dynamic

“Toggle button” class

1

Toggle

2

Optional

“Push button” class

1

Normal (transmit)

2

Text

“List Box” class

4

Dynamic List Box

“Menu item” class

1

Normal

2

Toggle

3

Optional

4

Cascade

5

Horizontal separator

6

Vertical separator

10

Exit

11

Break

12

About

13

Scroll page

14

Scroll line

15

Scroll block

16

Cut

17

Copy

18

Paste

19

Undo

20

Select text

21

Clear Text

22

Close Window

23

Scroll pause

24

Show help file’s “contents” topic

25

Show specified help topic (the menu item’s tag is used to identify the topic)

26

Show the search dialog for the help file

27

Show specified help topic (the tag of the form field that currently has focus is used to identify the topic)

28

Clear the clipboard

For Windows

Code

Meaning

1

Pop-up (the widow is physically independent of other windows – DEFAULT)

2

Clipped (the window is a child of the parent window)

Remarks

Only pop-up windows (subclass 1) can have menu bars.

Field BC

Indicates the background color to be used for the object.

Valid Values

A non-negative integer from the color table (below)

Remarks

If the attributes WdgBCBlue, WdgBCGreen, and WdgBCRed are all non-null, they, not BC, will determine the background color.

The special color code 0 indicates that the object is to take its background color from its parent object. For example, a check box in a frame would take the frame’s background color. If the BC setting for the frame is also 0, then the frame takes the window’s background color. If the window has no parent, and if its BC setting is also 0, then the window takes its background color from the MS-Windows control panel.

See Also

Predefined Color Constants, FC.

Field DataMask

The masking pattern used to display the form field’s data value.

Valid Values

The applicable masking pattern characters depend on the data type (DT) of the form field (e.g., non-digit, alphanumeric, numeric, and date)

Remarks

Currently, DataMask is used only for entry fields.

In text-class windows, the DataMask acts as both a display and an input mask.

In graphic windows, the DataMask acts solely as a display mask.

The data entered by the end-user should conform to the data type assigned to the form field (e.g., if the field is date, the entry is a number of the form YYYYMMDD). When the form field loses focus, the data is formatted according to the DataMask.

For a more detailed explanation of mask patterns and their relation to data types, see Masking.

Behavior of the DataMask attribute in Text and Graphich Windows

 

Display-Masked Form Fields in Text-Class Windows

Display-masked form fields are shown with the display mask in place only when:

  • the form field is unprotected (e.g., awaiting input), or
  • there is data in the form field (e.g., browsing records).

At all other times, the display mask is suppressed.

If an unprotected numeric form field has a display mask consisting entirely of floating $s or Zs, the appearance of the mask in an empty form field varies depending on the AN (allow nulls) attribute as follows:

Masking PatternNulls Allowed (AN=”Y”)Nulls Not Allowed (AN=”N”)
ZZZ.ZZ(field fill characters)0
$$$.$$(field fill characters)$0
  • If the same form field also has the VR (value required) attribute set to Y and is empty, the form field is displayed as shown in the Nulls Allowed (“Y”) column, above.
  • In a form field with AN (allow nulls) set to Y and a floating $ mask, the dollar sign appears as soon as a digit is typed into the form field.
  • If a form field with a floating mask is erased, or if all the digits in the form field are deleted, the mask disappears. (Only fill characters are displayed.)

Display-Masked Form Fields in Graphic Windows

A display-masked form field is shown with its mask in place whenever:

  • the field does not have focus; or
  • the field has focus, but is not available (i.e., is guarded, protected, or unavailable).

See Also

AN, CM, DT, FieldLen, WdgInputMask

Field WdgBorderStyle

Specifies the type of border an object is to have.

Valid Values

An integer code, as shown in the tables that follow.

For FormFields

Code

Meaning

0

No border

1

Inherited border style from old versions of Zim; normally, it is automatically converted to border style 2 at run time

2

Standard 3D border style

3

Single line border style

4

Bevelled in border style

5

Bevelled out border style

For Windows

Code

Meaning

0

No border

1

Single (a single-line border)

2

Double (a double-line border)

3

Custom (a user-defined border – DEFAULT)

4

Back screen border

5

Single with a status bar

6

Double with a status bar

7

Custom with a status bar

Remarks

In Windows, this field is ignored if Bord is No.

Only a single-bordered window can be resized by dragging. A window must have a single or double border if it is to have a caption and control buttons.

See Also

Bord, BordDefault

Field WdgAutoSize

“Autosize” status of an object. Indicates how windows and form fields that contain images are sized.

Valid Values

An integer code, as shown in the tables that follow.

For FormFields

Code

Meaning

0

No automatic sizing.  If the image is larger than the form field’s dimensions, then the image will be clipped at the right and bottom.  If the image is smaller, it will be centered.

1

Resize the image to fit the form field’s dimensions. The image may be disproportionately stretched and therefore degraded.

2

Resize the form field’s dimensions to fit the image.

3

Resize the image proportionally to fit within the form field’s dimensions. As with code 1, some image degradation may occur; however, it will be less drastic. The resulting image will always be equal to, or smaller than that produced by code 1.

For Windows

CODEMEANING

0No automatic sizing.  If the window is smaller than the form or display that is to appear within it, the form or display will be clipped at the right and bottom. If the window supports scroll bars, the scroll bars will appear to permit end-user scrolling to view the clipped portions of the form or display.

1Resize the window to fit the form or display.

en_CAEnglish