WinStudio

Use Free Form, Data Type, and Format Properties

Data type and format definitions for components that have the Use Free Form property enabled are specified with the Data Type property and the Format property rather than with the properties normally used.

Definitions consist of WinStudio keywords and parameters. The use of keywords allows you to specify substitution keywords rather than literal values as parameters. Variable values can be set programmatically through the application and retrieved as keyword parameters at run time.

Use Free Form Property

Setting Description
True Data type and format definitions for the component are specified with the Data Type property and the Format property, rather than with properties normally used.
False Default. Data type and format definitions for the component are specified in the normal way.

NOTE: If you use the Free Form property and you want to set conditions for Enabled When, Required When, or Visible When properties, you must do so using the appropriate keywords in the Data Type property field for the Free Form property. Setting the Free Form property value to True disables those property fields in the Component Property sheet.  

Data Type Property

The following table maps keywords for data type definitions to property names in the component properties sheet.

This property is enabled only if you have the Free Form property set to True.

Keyword Component Property
DATATYPE Underlying Type
LENGTH Length
DECIMALPOINT Decimal Point Position
BOOLTRUE Boolean True
BOOLFALSE Boolean False
DEFAULTVALUE Default Value
CASE Upper or Lower Case
ENABLEDWHEN Enabled When
REQUIREDWHEN Required When
VISIBLEWHEN Visible When

A value of the Data Type property is specified as follows:

keyword1 ( parameter ) [keyword2 ( parameter ) . . . keywordn ( parameter ) ]

Format Property

The following table maps keywords for format definitions to property names in the component properties sheet.

This property is enabled only if you have the Free Form property set to True.

Keyword Component Property
DEFAULTFORMAT n.a.
DECIMALPOINT Decimal Point Position
TRUNCATEDECIMAL Round
DATE | TIME | DATETIME Date Format
BLOBFORMAT Binary Data
COMMA n.a.
COMMAS n.a.
DECIMAL n.a.
FONT Font
FORECOLOR Foreground Color
BACKCOLOR Background Color
MASK Input Mask
AUTOIME Default IME Character Set
JUSTIFY Justification

A value of the Format property is specified as follows:

DEFAULTFORMAT ( keyword1 ( parameter ) [ keyword2 ( parameter ) . . . keywordn ( parameter ) ] )

The keyword DEFAULTFORMAT is optional in a Format value for a component.

Component Classes and Property Class Extensions

In a component class or property class extension, Data Type and Format values are combined as follows:

keyword1 ( parameter ) [keyword2 ( parameter ) . . . keywordn ( parameter ) ] DEFAULTFORMAT ( keyword1 ( parameter ) [ keyword2 ( parameter ) . . . keywordn ( parameter ) ] )

Note that all format keywords are specified as parameters to the DEFAULTFORMAT keyword. See the example below.

Example

In the following definition from a component class, parameters of the keywords are temporary, global variables.

DATATYPE(V(AcctDataType))LENGTH(V(AcctLength))DEFAULTFORMAT(MASK(V(AcctInputMask))JUSTIFY(V(AcctJustify)))

Values of the variables are set at system startup by an IDO method call. At run time, the expression evaluates to

DATATYPE(NUMSORTCHAR)LENGTH(5))DEFAULTFORMAT(MASK(ZZZZZ))JUSTIFY(R))

In the property sheet for the component class, NUMSORTCHAR appears as the Underlying Type, and 5 appears as the Length. The Input Mask value is ZZZZZ, and the Justification property is Right. All values are read-only.