|
|
|
|
|
- Properties specific to the description of items in the code
- How to describe data files programmatically?
- Handling the items of a data file described programmatically
- Logging
Item Description (Variable type) In french: Description de Rubrique (Type de variable)
Available only with these kinds of connection
An Item Description variable is used to describe one or more items in a data file programmatically. The description of each item is validated by HDescribeItem. After this validation: - This item can be handled like any other item described in the analysis.
- The "Item Description" variable is reinitialized and can be used to describe another data file item programmatically.
MyItem is Item Description MyItem1, MyItem2 are Item Descriptions
...
MyItem is Item Description
MyItem.Name = "NAME"
MyItem.Type = hItemText
MyItem.Size = 40
MyItem.KeyType = hUniqueKey
HDescribeItem(AFile, MyItem)
...
Syntax
Declaring one or more item descriptions Hide the details
<Variable name> is Item Description <Variable name 1>, <Variable name 2> are Item Descriptions
<Variable name>: Name of the "Item Description" variable to declare.Remark: The a and an keywords are optional: they provide better readability. To describe an "Item Description" variable: use the WLanguage properties specific to the item descriptions. For more details, see remarks. To validate the description of an "Item Description" variable: use the HDescribeItem function. Remarks Properties specific to the description of items in the code The following properties are specific to the item descriptions: Remark: The properties written in bold followed by a star must necessarily be initialized when defining an item programmatically. | | Property name | Effect |
---|
AccentSensitive | Take the accented characters into account when performing searches on the item | CalculatedDefaultValue | Define the SQL expression returning the default value of the item. | CalculatedItemExpression | Define the SQL expression that returns the value of a calculated item (Expression item). | CaseSensitive | Take the case (uppercase/lowercase characters) into account when performing searches on the item | Component | Modify a component of a composite key | DecimalPart | Define the number of digits in the decimal part of a Numeric item. | DefaultValue | Default value of an item. | GDPR | Determine if the item contains GPDR-relevant data. | IntegerPart | Define the number of digits in the integer part of a Numeric item. | KeyExpression | Define the components of a composite key. | KeySize | Size of the section to index in the text memo. | KeyType | Characteristics of a key item. | Language | Define the parameters of the language used to perform the comparisons and the sort for a Unicode item. | LanguageDescribed | Define the parameters of the language used to perform the comparisons and the sort for a Unicode item. | MaxThumbnailHeight | Define the maximum height of an item thumbnail. | MaxThumbnailWidth | Define the maximum width of an item thumbnail. | Name ( * ) | Name of item. | NbArrayElement | Number of elements in an array item. | Null | Take the "NULL by default" option into account for the item. | NullAllowed | Define whether the NULL value is allowed (or not) for the item. | PersistedCalculatedItem | Define whether the value of a calculated item (Expression type) is stored in the data file. | PunctuationSensitive | Take the punctuation characters (comma, period, ...) into account when performing searches on the item | Size(* required depending on the specified type) | Size of a text item (character string, text memo, character) Size of a Time item. | SortType | Characteristics of the sort on an item. | spDerivation | Define the key derivation function used for hashing ("Password" item). | spHash | Define the algorithm used for salting ("Password" item). | spIterationCount | Define the iteration count of the hash algorithm ("Password" item). | spLength | Defining the hash output length ("Password" item). | TimestampType | Define the type of timestamp for the item. | TimestampUTC | Define whether the time of a timestamp item is UTC or not. | Type (* ) | Identifies and modifies the type of an item. | TypeDescription | Specify the type associated with an Enumeration or Combination item. |
Special case: Describing a composite keyWhen describing a composite key programmatically, Type is optional. On the contrary, KeyExpression must be used to describe the composition of the composite key. Special case: Describing a primary key: - You must indicate that the item is a primary key, using the KeyType property.
- If the item can hold null values (NullAllowed property set to True) but can also be primary key, the NullAllowed property of the item will be automatically set to False.
Special case: Describing a Combination or Enumeration variable: - You must call TypeDescription to define the type used by the item.
- It is necessary to specify the type with the Type property before specifying the default value with the DefaultValue property.
Special case: Describing a Timestamp item: - The item must be a DateTime, Date or Time item.
- It is necessary to specify the timestamp type with the TimestampType property.
Special case: Describing an Expression item:: The Type property must not be used to describe an Expression item. You must use CalculatedItemExpression to describe the calculation expression. How to describe data files programmatically? To describe data files programmatically: - For each data file:
- If necessary, describe the characteristics of the links using HFSQL properties.
- If necessary, validate the description of each link (HDescribeLink).
Handling the items of a data file described programmatically When creating a data file in the data model editor, the names of the data files and items are automatically recognized by the compiler. When creating a data file using a "File Description" variable, the names of the data file and its items can be defined with the Name property. These names are not automatically recognized by the compiler. A compilation error occurs if these names are used to identify the data file or the items. To allow the compiler to recognize the names of the data file and items described in the code, the data file name must be declared as data source. Then, this data file and its items can be handled by their name in the code editor. For example: AFile is File Description ... AFile.Name = "CUSTOMER" ... HDescribeFile("CUSTOMER") ... CUSTOMER is Data Source ... HReadFirst(CUSTOMER, "CUSTNAME") Remark: The name of the data file can also be declared with the Extern keyword. However, the process execution will be slower. Logging When the data file is described programmatically: - if the data file is logged and if no item is logged, all the items (except for the composite keys) are automatically logged.
- if the data file is logged and if at least one item is logged, the other items are not modified.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|