ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Tools / WDOptimizer
  • Syntax
  • The following syntax enables you to start WDOptimizer in command line
  • Examples
  • Example of reindex procedure
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Syntax

The following syntax enables you to start WDOptimizer in command line

WDOptimizer /Fic=<Directory>
/Pwd=<Password>
/Option=<Type of action performed>
/Log=<Log file>
/Mute=<Yes/No>
/ExploreSubDir=<Yes/No>
/CompressIndex=<Yes/No>
/DelIndex=<Yes/No>
/GetMemos=<Yes/No>
/KeepCrossedRec=<Yes/No>
/Charset=<Character set>
/Density=<Density rate>
/Language=<Display language>
/Bck=<Yes/No>
The table below presents the different elements that can be found on the command line:
ParameterMeaning
/Fic=<Directory>To process a single data file: full path of the data file to be processed.
To process a set of data files:
  • path of a directory,
  • INI file in export format generated by WDOptimizer.
To process transactions: full path of the transaction file.
Example c:ASLASH_Temp\file.fic
/Pwd=<Password>Password associated with the data file to process (single data file)
/Option=<Type of action to perform>Number corresponding to the option of WDOptimizer to start:
1: Index check.
2: Optimize index speed (Recalculate data file statistics).
3: Rebuild indexes.
4: Rebuild indexes and memos.
5: Revise and compress indexes and memos.
/Log=<Log file>Full path of the log file (.log) to create. This file is created only if an option from 1 to 5 is selected.
/Mute=<Yes/No>Yes to automatically validate the report window (No by default).
/ExploreSubDir=<Yes/No>"Yes" to explore subdirectories of the directory specified in the "/Fic" parameter ("No" by default).
/CompressIndex=<Yes/No>Yes to delete inactive records when reindexing (options 3 and 4) (No by default).
/DelIndex=<Yes/No>Yes to delete the damaged records (options 3 and 4) (No by default).
/GetMemos=<Yes/No>Yes to try to retrieve the data from the memo if it is damaged (option 5) (No by default).
/KeepCrossedRec=<Yes/No>Yes to keep the crossed records (option 5) (No by default).
/Charset=<Charset>Used to specify the character set used for the reindex operation. You have the ability to use one of the constants corresponding to the character set to use.
charsetArabicArabic characters
charsetBalticBaltic characters
charsetChineseChinese characters (People's Republic of China)
charsetDefaultUses the computer's default character set. No character set is forced.
charsetEastEuropeEastern European characters (Polish, etc.)
charsetGreekGreek characters
charsetHebrewHebrew characters
charsetJapaneseJapanese characters
charsetKoreanKorean characters
charsetOccidentalRoman characters in ANSI standard
charsetRussianRussian characters
charsetThaiThai characters
charsetTraditionalChineseTraditional Chinese characters (Republic of Taiwan)
charsetTurkishTurkish characters
charsetUTF8Used to manage the countries with two character sets (Hong Kong) and the countries with no character set defined in Windows (Georgian and Armenian).
charsetVietnameseVietnamese characters
/Density=<Density rate>Density rate of indexes. This rate is set to 80 by default.
The higher this rate is, the denser and smaller the index is. In this case, iterations, searches, filters and queries will be faster. The additions of records and the modifications of records may be slower.
The lower this rate is, the less dense and the bigger the index will be. In this case, iterations, searches, filters and queries will be slower. The additions of records and the modifications of records will be faster.
/Language=<Display language>"US" to start WDOptimizer in English (French by default).
/Bck=<No>By default, the data files to be processed are saved (only taken into account if /option = 5). No if you don't want to perform this backup.
Examples
The following command line reindexes the data files in the "C:\MyAppli\Data" directory.
ExeRun("C:\MonRépertoire\WDOptimizer.EXE /Fic=C:\MonAppli\Données")
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)

Example of reindex procedure

// Variables globales du projet 
gsNomAppli is string = "MonAppli"
gsRepData is string = CompleteDir(fExeDir()) + "Data\"
//Procédure globale au projet 
PROCEDURE gWdOptimiseAnalyse(_NumOption = 5,_bSauvegarde = False)
// Pilotage de WDOPTIMIZER pour tous les fichiers de données d'une appli 
// avec prise en compte de mot de passe, ExeActif et 
// WDOptimizer bloquant quand il s'exécute. 
// Après chaque réindexation, WDOptimizer affiche le message
// "La réindexation du fichier de données 'C:\.....\MonFic.Fic' s'est déroulée correctement".
// L'utilisateur doit cliquer sur "Ok".
// Par défaut l'option 5 de WDOptimizer est utilisée
// Par défaut les fichiers de données ne sont pas sauvegardés avant optimisation
// - Requis : 
//   - Les fichiers de données peuvent être délocalisés par rapport à l'exe 
// (Variables globales gsNomAppli et gsRepData)
//  - WDOptimizer est toujours à côté de l'exécutable
//  - Les fichiers de données peuvent avoir un nom physique différent du nom logique 
// ainsi qu'une extension <> ".FIC"
 
// Variables locales au traitement
sListFichier, sNomFichier are strings
sSauvegarde is string = "Faux"
IF _bSauvegarde = True THEN sSauvegarde = "Vrai"
	i is int = 1
	sRep is string = CompleteDir(fExeDir())
	 // Nom physique du fichier (nom + extension)
	sNomPhysFichier is string
	// Mot de passe du fichier 
	sMdp is string 
	sLigneCommande is string

	// Vérification de la présence de WDOptimizer
	IF fDir(sRep + "WDOptimizer.EXE", frFile) = "" _OR_ ...
				fDir(sRep + "WDOutil.WDK", frFile) = "" THEN 
			Error("L'outil WDOptimizer n'a pas été correctement installé")
		RETURN
	END

	// Liste des fichiers de données de l'analyse
	sListFichier = HListFile()
	sNomFichier  = ExtractString(sListFichier, i, CR)
	WHILE sNomFichier <> EOT 
		sNomPhysFichier = {sNomFichier}..PhysicalName + {sNomFichier}..Extension
		IF fDir(gsRepData + sNomPhysFichier, frFile) <> "" THEN 
			// Prise en compte des mots de passe de certains fichiers de données protégés  
		SWITCH Upper(sNomFichier)
			CASE "TOTO" : sMdp = "toto"
			OTHER CASE : sMdp = ""  
		END
		IF sMdp <> "" THEN 
			sLigneCommande = 
				sRep + "WDOptimizer.EXE   /Fic=" + ...
				gsRepData + sNomPhysFichier + " /mdp=" + sMdp + " /" + ...
					_NumOption + " /" + sSauvegarde
		ELSE
				sLigneCommande = sRep + "WDOptimizer.EXE   /Fic=" + ...
					 gsRepData + sNomPhysFichier + " /5 /" + sSauvegarde
			END
		ExeRun(sLigneCommande, exeActive, exeWait)
	END
	i++
	sNomFichier  = ExtractString(sListFichier, i, CR)
END
Info("Optimisation des fichiers de données de '" + gsNomAppli + "' terminée")
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/07/2025

Send a report | Local help