PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Example 1: Creating an alias to use the data found in an archived file
  • Example 2: Copying data between two files with the same structure
Example 1: Creating an alias to use the data found in an archived file
Windows MobileWindows MobileHFSQLStored procedures The following example is used to handle the data found in the Orders2013 file (order file for the year 2013) archived in the D:\SalesMgt\Archive2013 directory. This file corresponds to the description of the ORDERS file found in the analysis.
// Create an alias for the ORDERS file
// (Syntax available from version 19)
Orders2013 is Data Source <description=Orders>
IF HAlias(Order, Order2013) = True THEN
// ORDERS2013 can now be used in the processes
// It behaves the same way as
// the ORDERS file described in the analysis.
// Modify the directory
HChangeDir(Orders2013, "D:\SalesMgt\Archive2013")
// Modify the name
HChangeName(Orders2013, "Orders")
HOpen(Orders2013)
...
// Processes on the Orders2013 file
...
END
// Cancel the alias
HCancelAlias(Orders)
Example 2: Copying data between two files with the same structure
Minimum version required
  • Version 9
This page is also available for…
Comments
EXAMPLE
// Sincronização de dados

TempCliente is Data Source

HAlias(Cliente, TempCliente)

HCreationIfNotFound(TempCliente)



FOR EACH Cliente WHERE Enviado = 0

TempCliente.A = Cliente.A

TempCliente.B = Cliente.B

HAdd(TempCliente)

END



HCloseConnection(ConnectionLOCAL)

HOpenConnection(ConnectionSERVER)

HchangeConnection(*,ConnectionSERVER)



FOR ALL TempCliente

IF HCopyRecord(Customer, TempCustomer) THEN

Hadd(Cliente)

END

END



HCancelAlias(TempCustomer)

fDelete(Diretorio,"TempCustomer.fic")

Info("Transferência realizada com sucesso!")

//Pra quem gosta das coisas mastigadas (FABRICIO ALMEIDA)
BOLLER
06 Jan. 2018