ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Corrupted index
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
<Source>.CheckIndex (Function)
In french: <Source>.VérifieIndex
HFSQLHFSQL Client/ServerAvailable only with these kinds of connection
Checks whether the data found in the index file (.NDX file) properly refers the data found in the data file (.FIC file). This function applies to the HFSQL data files (Classic or Client/Server) only.
HFSQL Client/Server The HFSQL Client/Server data file is automatically locked in write mode during the check.
Reminder: An index is corrupted when one of the referenced records is not the expected one. In this case, the data file must be re-indexed.
Example
// Vérification de l'index
soit RésultatIndex = Client.VérifieIndex()
// Gère le résultat
SELON RésultatIndex
CAS 0
Info("Index correct")
CAS 1
Info("Le fichier nécessite une optimisation.")
CAS 2
Info("Erreur HFSQL " + HErreur() + " pendant le test")
FIN
Syntax
<Result> = <Source>.CheckIndex([<Key item> [, <Progress Bar>]])
<Result>: Integer
Can correspond to:
  • 0 if the check is correct.
  • 1 if the index is corrupted: re-indexing is necessary (function <Source>.Index)
  • 2 if an HFSQL error occurred: the data file cannot be accessed, etc.
  • 3 if the function is not supported by this type of data file (xBase, AS400, etc.)
<Source>: Type corresponding to the specified source
Name of the data file used.
<Key item>: Optional character string
Name of the key item to check. If this parameter is not specified, all the keys of the data file are checked.
<Progress Bar>: Optional control name or window name
  • Name of window where the progress bar will be displayed,
  • Name of the Progress Bar control to use.
WEBDEV - Server code This parameter is ignored.
Remarks

Corrupted index

When the function detects a problem in the index file, the H.Comment variable contains:
<Nom de la clé concernée> + TAB + <Numéro de l'enregistrement posant problème> + RC +
<Nom de la clé concernée 2> + TAB + <Numéro de l'enregistrement posant problème 2> ...

<Record number causing problem> is equal to -1 if no record was defined.
Remark: The H.Comment variable is not filled if the index file is entirely corrupted.
Component: wd270hf.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/06/2023

Send a report | Local help