|
|
|
|
|
- Example: Creating a data file through programming made of 3 items (one of them being a composite key)
Example: Creating a data file through programming made of 3 items (one of them being a composite key) EXTERN Temp_File
EXTERN Item1
EXTERN Item2
EXTERN CompItem
MyFile1 is File Description
MyItem1 is Item Description
MyItem2 is Item Description
MyCompositeKey is Item Description
MyFile1.Name = "Temp_File"
MyFile1.Type = hFileNormal
MyItem1.Name = "Item1"
MyItem1.Type = hItemText
MyItem1.Size = 20
HDescribeItem(MyFile1, MyItem1)
MyItem2.Name = "Item2"
MyItem2.Type = hItemText
MyItem2.Size = 20
HDescribeItem(MyFile1, MyItem2)
MyCompositeKey.Name = "CompItem"
MyCompositeKey.KeyExpression = "Item1+Item2"
HDescribeItem(MyFile1, MyCompositeKey)
HDescribeFile(MyFile1)
HCreate(Temp_File)
Temp_File.Item1 = "Montpellier"
Temp_File.Item2 = "Paris"
HAdd(Temp_File)
Temp_File.Item1 = "Marseille"
Temp_File.Item2 = "Lyon"
HAdd(Temp_File)
HReadSeek(Temp_File, CompItem, HBuildKeyValue(Temp_File, CompItem, "Marseille", "Lyon"))
IF HFound() = True THEN
Trace(Temp_File.Item1, Temp_File.Item2)
END
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|