AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Propiedades WLanguage / Propiedades varias
  • 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)
WINDEVWEBDEV - Código ServidorWindowsAjaxHFSQL Classic This example is used to create a data file through programming. This data file contains two simple items and a composite key.
Once the data file is created, it is filled with data and a search is performed the 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
 
// Declare the file
MyFile1.Name = "Temp_File"
MyFile1.Type = hFileNormal
 
// Declare the item 1
MyItem1.Name = "Item1"
MyItem1.Type = hItemText
MyItem1.Size = 20
HDescribeItem(MyFile1, MyItem1)
 
// Declare the item 2
MyItem2.Name = "Item2"
MyItem2.Type = hItemText
MyItem2.Size = 20
HDescribeItem(MyFile1, MyItem2)
 
// Declare the composite key
MyCompositeKey.Name = "CompItem"
MyCompositeKey.KeyExpression = "Item1+Item2"
HDescribeItem(MyFile1, MyCompositeKey)
 
HDescribeFile(MyFile1)
HCreation(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
Versión mínima requerida
  • Versión 9
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 08/03/2023

Señalar un error o enviar una sugerencia | Ayuda local