Click or drag to resize

DataField Class (Typed)

X#
Create a field, which is an object that holds information that defines a particular field in a data server (for example, the field's data type and length).
Inheritance Hierarchy
Object
  DataField
    SQLValue

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VOSystemClasses (in XSharp.VOSystemClasses.dll) Version: 2.21
Syntax
[TypesChangedAttribute]
 CLASS DataField
Request Example View Source

The DataField type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyFieldSpec
The FieldSpec object connected to this field.
Public propertyHyperLabel
The hyperlabel connected to this field.
Public propertyName
A string representing the name of the field.
Public propertyNameSym
A symbol representing the name of the field.
Top
Functions
  NameDescription
Public methodAsString
Return the descriptive label defined for this field.
Top
Remarks
A DataField object is a specific item in a database record. This is in contrast to a FieldSpec object, which is a description of the properties that some field might have. For example, assume you want to create a FieldSpec object that defines an employee number and you have an EMPLOYEE database that has two different fields: EMPNO, which the employee's number (the employee whose record this is), and MGRNO, which is the number of that employee's manager. Thus, you might define the FieldSpec object as follows:
X#
1CLASS EmployeeNumber INHERIT FieldSpec
2...
and then in the database define two different fields as:
X#
1DataField{HyperLabel{#EmpNo, "Employee Number"}, ;
2EmployeeNumber{}}
3DataField{HyperLabel{#MgrNo, "Manager Number"}, ;
4EmployeeNumber{}}
Note that some of the field properties can appear redundant given the available FieldSpec properties. For example, the field contains a hyperlabel, but the field's FieldSpec object also contains a hyperlabel. Furthermore, the field's hyperlabel contains a symbolic name, and the FieldSpec's hyperlabel contains a symbolic name. However, this apparent redundancy serves a useful purpose. A FieldSpec's hyperlabel identifies the general class of data (called #EmpNo in this example). This name is often used as the standard name of fields of this type, but it does not have to be, because each particular field has a specific name — in the example above, #EmpNo and #MgrNo. A field, therefore, holds two "groups" of properties: General label information, like its name, caption, description, and help context ID Data type information, stored as a FieldSpec object, that includes data type, length, decimals, validation rules, error messages, diagnostics, and formatting rules In any case, all data-oriented objects in the system have a name and a hyperlabel, which are often shipped around the system for annotation and help purposes.
Important! There is rarely a need for the developer to consider the fields directly as they are typically created through the code generated by the various data server editors.
See Also