|
|
|
|
- Example for managing the positions in a data file
- Reinitializing positions
- Miscellaneous
- Repositioning by OLE DB and Native MySQL, DB2 and Informix Connectors
<Fuente>.SavePosition (Función)
No disponible con este tipo de conexión
Stores the current context of a data file: current record, filter, pointers. This allows you to temporarily suspend the current process in order for the data file to be used somewhere else (to perform checks for example). The saved context can be restored by . Then, the main process can continue. <Fuente>.SavePosition is used to save: - the number of the record used,
- the different pointers in the index (the position in the index is saved for each key),
- the current filter. You will have to use the hRPFilter constant in to restore the stored filter.
This function can be used with the data files, HFSQL views or queries.
// Find a record Customer.ReadSeekFirst(Name, Name) WHILE Customer.Found() = True // Saves the current context nPos = Customer.SavePosition(Name) // Check a customer with another name Customer.ReadSeek(Name, Name2) IF Customer.Found() = True THEN Counter = Counter + 1 // Restores the context HRestorePosition(nPos) Customer.ReadNext(Name) END
Sintaxis
<Result> = <Source>.SavePosition([<Item>] [, <Options>])
<Result>: Entero - Number of the position that was saved,
- -1 if an error occurred.
<Source>: Tipo de fuente especificada Name of the data file, view or query used. If this name is not specified, <Fuente>.SavePosition will use the last data file used by the last HFSQL function (function starting with "H"). <Item>: Cadena de caracteres opcional Name of the item used. If this parameter is not specified, <Fuente>.SavePosition saves the positions of all items being looped through.
<Options>: Constante opcional de tipo Integer Used to configure the backup:
| | | hSaveItems | Saves the values of items in memory when using <Fuente>.SavePosition. These values will be restored next time is called. | |
Observaciones Example for managing the positions in a data file <Fuente>.SavePosition and can be used in the following cases for example: - form used to display a record and to loop through the data file according to a key. Another window is called to display the data as a table. Positions allow you to easily go back to desired record in the iteration.
- viewing a data file in a Table control. When selected, the record is displayed as a form, with the possibility of looping through forms. The position management allows you to display the Table control again while being properly positioned on the data file.
Miscellaneous - The number of calls to <Fuente>.SavePosition is not limited.
- You have the ability to nest <Fuente>.SavePosition and for the same data file.
- If the record pointed during the call to <Fuente>.SavePosition is deleted, cannot be called anymore.
Clasificación Lógica de negocio / UI: Lógica de negocio
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|