Jump to content

VRFormattedEntryField

From EDM2
Revision as of 02:41, 31 March 2017 by Martini (talk | contribs) (Created page with "The Formatted Entry Field Object allows you to control the way data is entered into a VX-REXX Entry Field. The Formatted Entry Field Object achieves this my modifying the stan...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The Formatted Entry Field Object allows you to control the way data is entered into a VX-REXX Entry Field. The Formatted Entry Field Object achieves this my modifying the standard entry field properties and filtering the keyboard input.

Three predefined formatted fields are supplied (see FieldType):

  • Date entry field
  • Time entry field
  • Currency entry field

Other than these you can define your own entry FieldMask using the available Mask Characters

Mask Characters

To help you define the allowable characters in a Formatted Entry Field, the following characters are defined and reserved for creating input masks.

  • # Only numeric characters ( 0..9) and punctuation characters are allowed at this position.
  • @ Any character can be entered at this position.
  • | Only non-numeric characters can be entered at this position.

Properties

The Formatted Entry Field Object inherits all the properties of the standard Entry Field Object and adds the following properties:

  • AllowSpaces
  • FieldType
  • ForceUpperCase
  • FieldMask
  • SpaceToZero


AllowSpaces

This property specifies whether the <Space> character is allowed in the input string. When set to 0, an error beep will be emmited if you type the <Space> character.

Data Type
Boolean
Possible Values
  • 1 (true)
  • 0 (false)

FieldType

This property determines what type of entry field is created :

  • Date the field will be formatted according to the current system date format.
  • Time the field will be formatted according to the current system time format.
  • Currency the field will be formatted according to the current system currency format.
  • User Defined the user defines the input FieldMask
Data Type
String
Possible Values
  • Date
  • Time
  • Currency
  • User Defined


ForceUpperCase

This property determines the allowed case of the characters entered into the field. If it is set, all characters typed into the field will be forced to upper case.

Data Type
Boolean
Possible Values
  • 1 (true)
  • 0 (false)

FieldMask

A string representation containing Mask Characters and literal characters. Input to the field is only allowed over the Mask Characters, all literals will remain untouched by editing.

Data Type
String
Possible Values
see Mask Characters


SpaceToZero

This property is for for numeric input fields. If set to 1 all spaces left in the field will be converted to the number 0 when the focus is lost.

Data Type
Boolean
Possible Values
  • 1 (true)
  • 0 (false)


Methods

The Formatted Entry Field Object apart from the following specific methods, all the standard Entry Field methods apply.

  • ValidateField

ValidateField

This method takes no parameters and only applies to Date or Time fields. It will check whether the contents of the field are valid:

Months part <= 12 
Days part in range for the month 
Hours part <= 23 
Minutes part <= 59 

User defined and Currency fields are not validated, the method always returning TRUE.

ok = VRMethod( object, "ValidateField");


Returns
  • 1 (true) Field is valid
  • 0 (false) Field is invalid