ThScmField
Defines a single field in a schema-based data structure.Each field describes one column of data, including its name, type, visibility, display title, and additional attributes.
Fields can be marked as calculated or linked to lookup sources. This structure is typically used to define the layout and behavior of records in a dataset.
TablePtr
Returns a pointer to the parent schema table that owns this field.Useful for accessing shared metadata or relationships defined at the table level.
function TablePtr: ThScmTable;
Return Value
Returns a reference to theThScmTable
instance that contains this field.Get_Enforce_Local_Lang_Combined
Returns a flag indicating whether combined local language rendering is enforced.Used internally by Delphi dialogs to determine multi-language support behavior.
function Get_Enforce_Local_Lang_Combined: Byte;
Return Value
Returns a byte value that indicates local language enforcement mode. Typically used only in UI-specific contexts.Json_Name
Returns the field's name formatted for use in JSON output.This ensures proper serialization and field naming consistency across exports.
function Json_Name: RawByteString;
Return Value
Returns the JSON-compatible name of the field as aRawByteString
.VisualName
Returns the display name of the field in the specified language. If the language is unspecified or unsupported, a fallback may be used.function VisualName(AtLang: ThTranslation_Language = he_Unknown): String;
Parameters
- AtLang: ThTranslation_Language; The language code for which the name should be returned.
ThTranslation_Language = (he_English{0}, he_Hebrew, he_Russian, he_Arabic, he_Spanish, he_Chinese, he_French, he_Hindi{7},
he_German, he_Unknown);
Return Value
Returns the field's user-visible name in the requested language.VisualName_For_Dynamic_DB_Wizards
Returns the field's display name adapted for dynamic database wizards.The format may differ from regular display names to suit wizard-specific contexts.
function VisualName_For_Dynamic_DB_Wizards: String;
Return Value
Returns a string used as the field's caption in dynamic database wizard interfaces.Get_ValuesList
Returns a semicolon-separated list of possible values for the field, based on the specified language.Typically used for enum-type fields or dropdown lists in UI editors.
function Get_ValuesList(AtLanguage: ThTranslation_Language = he_Unknown): String;
Parameters
- AtLanguage: ThTranslation_Language; The language context for value translation (default is local translation).
Return Value
Returns a string containing the field’s possible values, formatted for the specified language.Set_Field_Caption
Updates the display title of the field for a given language. This overrides the default or previously translated caption.procedure Set_Field_Caption(CONST New_Vis_Name: String; CONST AtLanguage: ThTranslation_Language);
Parameters
- New_Vis_Name: String; The new display caption for the field.
- AtLanguage: ThTranslation_Language; The language in which the caption should be set.
Translate_Field_Title
Translates the original field caption, with optional consideration of the local currency.Used to dynamically adjust UI labels to match localized naming and currency symbols.
procedure Translate_Field_Title(Origin_Caption: String; CONST Local_Currency: String = '');
Parameters
- Origin_Caption: String; The original title to be translated.
- Local_Currency: String; Optional currency symbol or abbreviation to embed into the translated title.
rt_Add_Val
Adds a new value to the runtime value list of the field.Can optionally skip validation against the predefined length constraint.
procedure rt_Add_Val(New: String; Skip_Length_Check: Boolean = False);
Parameters
- New: String; The value to add to the field’s runtime list.
- Skip_Length_Check: Boolean; If
True
, the new value will be added without validating its length.
Skip_Spare_Field
Indicates whether the field should be excluded from certain operations due to being a spare or placeholder field.function Skip_Spare_Field: Boolean;
Return Value
ReturnsTrue
if the field is marked as a spare and should be skipped in processing.Returns
False
otherwise.StorageType
Returns the internal storage type assigned to the field. This type controls how the data is stored in memory or on disk.function StorageType: Thds_FldStorage;
Return Value
Returns aThds_FldStorage
value that defines the storage model used for this field.Thds_FldStorage
Defines the low-level memory storage format used for a field in a data schema.This type is used internally for efficient allocation and access of record fields.
Type | Description |
---|---|
he_WideChar | Stores the field as a wide-character (Unicode) string. |
he_Double | Stores the field as a 64-bit floating-point number. |
he_Byte | Stores the field as a single byte value. |
he_Extended | Stores the field as an extended precision floating-point value. |
Size_In_Bytes
Returns the size of the field in bytes, based on its data type and width.Useful for calculating record memory footprint or offsets.
function Size_In_Bytes: Cardinal;
Return Value
Returns the size of the field in bytes as aCardinal
.Offset_In_Bytes
Returns the byte offset of the field relative to the start of the record.Used for low-level memory alignment or direct record access.
function Offset_In_Bytes: Cardinal;
Return Value
Returns the byte offset position of the field as aCardinal
.Name
Specifies the internal name of the field.This value is used as a unique identifier within the schema or dataset.
property Name: String;
Kind
Defines the data type of the field using theThDataType
enumeration.This determines how the field's value is interpreted and validated.
property Kind: ThDataType;
ThDataType
Defines the logical data type of a field in the schema.This type influences validation, formatting, UI presentation, and storage logic.
Type | Description |
---|---|
he_String | Plain text or alphanumeric string. |
he_Serial | Auto-increment or unique serial number. |
he_Name | Personal or entity name, used for formatted display or lookup. |
he_Phone | Phone number, possibly validated or formatted for regions. |
he_Integer | Whole numeric value without decimals. |
he_Real | Floating-point numeric value. |
he_Money | Currency or financial value with formatting rules. |
he_Bool | Boolean value (True/False). |
he_Date | Calendar date. |
he_Hour | Time of day (hour and minute). |
he_FixDT | Fixed date-time value (combined date and time). |
he_Status | Status indicator field. |
he_Month | Month representation (usually numeric or abbreviated string). |
he_Week | Week number within the year. |
LocalLang
Indicates whether the field supports translation using local language data.Used primarily for multilingual UI rendering or localization-aware processing.
property LocalLang: Boolean;
TextLength
Specifies the maximum character length for text fields.Used for validation, memory allocation, and UI input constraints. Default Value 10
property TextLength: Word;
DefStr
Defines the default string value for the field. Used when initializing new records or resetting values.property DefStr: String read FDefstr write FDefstr;
DutyField
Marks the field as a primary duty field for display or filtering purposes.This is typically used in dynamic forms or report generation logic.
property DutyField: Boolean;
DutyField2
Marks the field as a secondary duty field.Used similarly to
DutyField
but with lower priority.property DutyField2: Boolean;
DutyGroup
Assigns the field to a specific duty group for categorization or filtering.Useful for layout grouping or hierarchical form generation.
property DutyGroup: Byte;
CheckExtMinValue
Indicates whether the field should enforce an external minimum value constraint.If enabled, the
ExtMinValue
is checked during validation or user input.property CheckExtMinValue: Boolean;
ExtMinValue
Defines the minimum allowed value for the field, if external range checking is enabled.property ExtMinValue: Double;
CheckExtMaxValue
Indicates whether the field should enforce an external maximum value constraint.If enabled, the
ExtMaxValue
is checked during validation or user input.property CheckExtMaxValue: Boolean;
ExtMaxValue
Defines the maximum allowed value for the field, if external range checking is enabled.property ExtMaxValue: Double;
EditorType
Specifies the editor type associated with the field, which controls how it is presented and edited in UI components.property EditorType: ThEditorType;
ThEditorType
Defines the type of editor control associated with a field for user interaction.This setting determines how the field is rendered and edited in UI components.
Type | Description |
---|---|
he_Edit | Standard single-line text editor. |
he_Select | Dropdown selector for choosing from predefined options. |
he_Memo | Multi-line memo editor for long text. |
he_PopupList | Popup list selector, often with custom rendering or dynamic loading. |
he_SelectEdit | Editable combo box allowing free text or selection from a list. |
he_GroupSelect | Grouped selection UI, often used for categorized choices. |
he_TextMemo | Formatted or styled multi-line text editor. |
he_PopupEdit | Popup editor that allows complex editing in a separate window or dialog. |
ReadOnly
Indicates whether the field is read-only.If set to
True
, the field cannot be edited by the user.property ReadOnly: Boolean;
SpareField
Marks the field as unused or reserved for future use.Such fields may be skipped in UI rendering or storage processing.
property SpareField: Boolean;
Hidden
Indicates whether the field should be hidden from user interface elements.Hidden fields remain part of the data model but are not shown in forms or grids.
property Hidden: Boolean;
ValuesList
Contains a semicolon-separated list of predefined values allowed for the field.Used mainly for selection editors such as dropdowns or popup lists.
property ValuesList: String;
Translation
Indicates whether the field supports translation of its display values.If enabled, UI elements may render translated captions or choices based on the active language.
property Translation: Boolean;
StrMask
Defines a mask pattern for validating or formatting string input.This is useful for enforcing formats like phone numbers, postal codes, or custom patterns.
property StrMask: String;
Prev_Field_Names
Contains a comma-separated list of legacy field names.Used for compatibility or migration purposes when field names are changed over time.
property Prev_Field_Names: String;
Design_Notes
Free-text documentation or annotations for internal use during schema design.This property has no runtime behavior and is intended for developers only.
property Design_Notes: String;
Enforce_Input_Lang
Specifies input language filtering behavior for the field.Used to enforce that the input is typed in a particular language script (e.g. Hebrew, English).
property Enforce_Input_Lang: ThEnforce_Input_Lang;
ThEnforce_Input_Lang
Defines rules for filtering or enforcing input language during text entry.This setting helps ensure that text input is typed in the expected script or language.
Type | Description |
---|---|
he_No_Filter | No language filtering is applied. Typically used for numeric or technical fields. |
he_Acceptable | Accepts characters from both Hebrew and English input sources. |
he_EnglishOnly | Restricts input to English characters only. |