AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Administrar bases de datos / HFSQL / Funciones HFSQL
  • Example for managing the positions in a data file
  • Reinitializing positions
  • Miscellaneous
  • Repositioning by OLE DB and Native MySQL, DB2 and Informix Connectors
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Stores the current context of a data file: current record, filter, read 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 <Source>.RestorePosition. Then, the main process can continue.
<Source>.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 <Source>.RestorePosition to restore the stored filter.
This function can be used with the data files, HFSQL views or queries.
Ejemplo
// Recherche d'un enregistrement
Client.LitRecherchePremier(Nom, Nom)
WHILE Client.Trouve() = True
	// Sauve le contexte en cours
	nPos = Client.SauvePosition(Nom)
	// Vérification d'un client d'un autre nom
	Client.LitRecherche(Nom, Nom2)
	IF Client.Trouve() = True THEN Compteur = Compteur + 1
	// Restaure le contexte
	HRestorePosition(nPos)
	Client.LitSuivant(Nom)
END
Sintaxis
<Result> = <Source>.SavePosition([<Item>] [, <Options>])
<Result>: Integer
  • Number of the position that was saved,
  • -1 if an error occurred.
<Source>: Type corresponding to the specified source
Name of the data file, view or query used. If this name is not specified, <Source>.SavePosition will use the last data file used by the last HFSQL function (function starting with "H").
<Item>: Optional character string
Name of the item used. If this parameter is not specified, <Source>.SavePosition saves the positions of all items being looped through.
Hyper File 5.5 The <Rubrique> parameter will be ignored: the position will be saved for all browse items in progress.
<Options>: Optional integer constant
Used to configure the backup:
hSaveItemsSaves the values of items in memory when using <Source>.SavePosition. These values will be restored next time <Source>.RestorePosition is called.
Java This constant is only available for HFSQL data files.
Observaciones

Example for managing the positions in a data file

<Source>.SavePosition and <Source>.RestorePosition 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.

Reinitializing positions

Please note: all functions which open or close a data file reset the context numbers (e.g. <Fuente>.Creation, <Fuente>.Close, ...).

Miscellaneous

  • The number of calls to <Source>.SavePosition is not limited.
  • You have the ability to nest <Source>.SavePosition and <Source>.RestorePosition for the same data file.
  • If the record pointed during the call to <Source>.SavePosition is deleted, <Source>.RestorePosition cannot be called anymore.
WINDEVJavaOLE DBConectores Nativos

Repositioning by OLE DB and Native MySQL, DB2 and Informix Connectors

If the database or the status of the iteration (e.g., reinitialized) does not allow resetting the position directly on the record, the position is set using the cache of records read.
The following functions reinitialize the iteration:
This operating mode is the same in Java.
Clasificación Lógica de negocio / UI: Lógica de negocio
Componente: wd300hf.dll
Versión mínima requerida
  • Versión 25
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

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