PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Properties specific to the description of items through programming
  • How to describe the data files through programming?
  • Handling the items of a data file described through programming
  • Logging
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Heading description (Type of Variable)
In french: Description de rubrique (Type de variable)
HFSQLHFSQL Client/ServerAvailable only with these kinds of connection
A variable of type description of Field is used to describe one or more fields of a data file by programming . 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 variable of type "description of Field" is reset and can be used to programmatically describe another data file field.
Remark: From version 19, HFSQL is the new name of HyperFileSQL.
Example
MaRubrique is Item Description
MaRubrique1, MaRubrique2 are Item Descriptions
// Description du fichier UnFichier
...
 
// Description de la rubrique "NOM"
MaRubrique is Item Description
MaRubrique.Name = "NOM"
MaRubrique.Type = hItemText
MaRubrique.Size = 40
MaRubrique.KeyType = hUniqueKey
 
// Validation de la description de la rubrique "NOM"
HDescribeItem(UnFichier, MaRubrique)
 
// Validation de la description du fichier UnFichier
...
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.

Describing a variable of type "description de Rubrique Hide the details

To describe a variable of type "description of Type ":
use the WLanguage properties specific to the item descriptions. For more details, see remarks.

To validate an description of type "description of type ":
use the HDescribeItem function.
Remarks

Properties specific to the description of items through programming

The following properties are specific to the item descriptions:
Remark: The properties written in bold followed by a star must necessarily be initialized when describing an item through programming.
Property nameEffect
ComponentModify a component of a composite key
Versions 20 and later
TypeDescription
New in version 20
TypeDescription
TypeDescription
Specify the type associated with an Enumeration or Combination item.
KeyExpressionDefine the components of a composite key.
Versions 21 and later
CalculatedItemExpression
New in version 21
CalculatedItemExpression
CalculatedItemExpression
Define the SQL expression that returns the value of a calculated item (Expression item).
MaxThumbnailHeightDefine the maximum height of an item thumbnail.
LanguageDefine the parameters of the language used to perform the comparisons and the sort for a Unicode item.
LanguageDescribedDefine the parameters of the language used to perform the comparisons and the sort for a Unicode item.
MaxThumbnailWidthDefine the maximum width of an item thumbnail.
NbArrayElementNumber of elements in an array item.
Name ( * )Name of item.
NullTake the "NULL by default" option into account for the item.
Versions 16 and later
NullAllowed
New in version 16
NullAllowed
NullAllowed
Define whether the NULL value is allowed (or not) for the item.
Versions 21 and later
PersistedCalculatedItem
New in version 21
PersistedCalculatedItem
PersistedCalculatedItem
Define whether the value of a calculated item (Expression type) is stored in the data file.
DecimalPartDefine the number of digits in the decimal part of a Numeric item.
IntegerPartDefine the number of digits in the integer part of a Numeric item.
Versions 26 and later
GDPR
New in version 26
GDPR
GDPR
Determine if the item contains GPDR-relevant data.
AccentSensitiveTake the accented characters into account when performing searches on the item
CaseSensitiveTake the case (uppercase/lowercase characters) into account when performing searches on the item
PunctuationSensitiveTake 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.
KeySizeSize of the section to index in the text memo.
Versions 21 and later
TimestampType
New in version 21
TimestampType
TimestampType
Define the type of timestamp for the item.
Versions 21 and later
TimestampUTC
New in version 21
TimestampUTC
TimestampUTC
Define whether the time of a timestamp item is UTC or not.
Type (* )Identifies and modifies the type of an item.
KeyTypeCharacteristics of a key item.
SortTypeCharacteristics of the sort on an item.
DefaultValueDefault value of an item.
Versions 21 and later
CalculatedDefaultValue
New in version 21
CalculatedDefaultValue
CalculatedDefaultValue
Define the SQL expression returning the default value of the item.

Special case: Describing a composite key
When describing a composite key through programming, Type is optional. On the contrary, KeyExpression must be used to describe the composition of the composite key.
Versions 20 and later
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.
New in version 20
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 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.
Versions 21 and later
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.
New in version 21
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.
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 the data files through programming?

To describe the data files through programming, you must:
  1. For each data file:
  2. Describe if necessary the characteristics of the links thanks to HFSQL properties.
  3. If necessary, validate the description of each link (HDescribeLink).

Handling the items of a data file described through programming

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 through programming:
  • 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.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment