ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Corrupted index
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
HCheckIndex (Function)
In french: HVérifieIndex
HFSQL ClassicHFSQL 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.
New in SaaS
HFSQL Client/Server The indexes of an HFSQL Client/Server data file can be checked asynchronously using the HCheckIndexAsynchronous function.
Note: This feature is only available from WINDEV Suite SaaS 2025 - Update 2.
For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.
Reminder An index is corrupted when one of the records it references is not the one expected. In this case, the data file must be re-indexed.
Example
// Vérification de l'index
let RésultatIndex = HCheckIndex(Client)
// Gère le résultat
SWITCH RésultatIndex
	CASE 0
		Info("Index correct")
	CASE 1
		Info("Le fichier nécessite une optimisation.")
	CASE 2
		Info("Erreur HFSQL " + HError() + " pendant le test")
END
Syntax
<Result> = HCheckIndex([<Data file> [, <Key item>] [, <Progress Bar>]])
<Result>: Integer
Can correspond to:
  • 0 if the check is correct.
  • 1 if the index is corrupted: reindexing is required (function HIndex).
  • 2 in the event of an HFSQL error: the data file is inaccessible, etc.
  • 3 if the function is not supported by this type of data file (xBase file, AS400, etc.).
<Data file>: Optional character string
Name of the data file used. If this name is not specified, HCheckIndex will use the last data file used by the last HFSQL function (function starting with "H").
<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 the window in which 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:
<Name of affected key> + TAB + <Record number causing problem> + CR +
<Name of affected key 2> + TAB + <Record number causing problem 2> ...

<Record number causing problem> is equal to -1 if no record was defined.
Note If the index file is completely corrupted, the variable H.Comment variable is left blank.
Component: wd300hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/28/2025

Send a report | Local help