PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Syntax
  • The following syntax enables you to start WDOptimizer in command line
  • Examples
  • Example of procedure for re-indexing
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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 process.
To process a set of data files:
  • path of a directory,
  • INI file in export format generated by WDOptimizer.
To process the transactions: full path of the transaction file.
Example: c:\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: Check the index.
2: Optimize the speed of indexes (recalculate the statistics on the data files).
3: Rebuild the indexes.
4: Rebuild the indexes and the memos.
5: Check and compress the indexes and the 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 the sub-directories of the directory specified in "/Fic" (No by default).
/CompressIndex=<Yes/No>Yes to delete the inactive records during a re-indexing operation (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 reindexing 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)
charsetTraditionalChineseTraditional Chinese characters (Republic of Taiwan)
charsetKoreanKorean characters
charsetDefaultUses the default character set defined for the computer. No character set is forced.
charsetEastEuropeCharacters of Eastern Europe (Polish, ...)
charsetGreekGreek characters
charsetHebrewHebrew characters
charsetJapaneseJapanese characters
charsetOccidentalRoman characters in ANSI standard
charsetUTF8Used to manage the countries with two character sets (Hong Kong) and the countries with no character set defined in Windows (Georgian and Armenian).
charsetRussianRussian characters
charsetThaiThai characters
charsetTurkishTurkish characters
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, the browses, 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, the browses, 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 files to process are saved (only taken into account if /option = 5). No if you don't want to perform this backup.
Examples
The command line below is used to reindex the files found in "C:\MyApp\Data".
ExeRun("C:\MyDirectory\WDOptimizer.EXE /Fic=C:\MyApp\Data")
WINDEVWEBDEV - Server codeReports and QueriesWindows MobileUser code (UMC)

Example of procedure for re-indexing

// Global variables of the project
gsAppName is string = "MyApp"
gsDataDir is string = CompleteDir(fExeDir()) + "Data\"
//Procedure global to the project
PROCÉDURE gWdOptimizeAnalysis(_OptionNum = 5,_bSave = False)
// Control WOPTIMIZER for all the files of an application
// while taking into account the password, exeActive and
// WDOptimizer is locking when it is run.
// After each reindex operation, WDOptimizer displays the message
// "The  'C:\ ...\MyFile.Fic' file was successfully reindexed".
// The user must click "OK".
// The option 5 of WDOptimizer is used by default
// By default, the files are not saved before optimization
// - Required:
//   - The data files can be relocated in relation to the exe
// (Global variables gsAppName and gsDataDir)
//  - WDOptimizer is always found beside the executable
//  - The files can have a physical name that differs from the logical name
// as well as an extension <> ".FIC"

// Variables local to the process
sFileList, sFileName are strings
sSave is string = "False"
IF _bSave = True THEN sSave = "True"
i is int = 1
sDir is string = CompleteDir(fExeDir())
 // Physical name of the file (name + extension)
sPhysicalFileName is string
// Password of the file
sPwd is string
sCommandLine is string

// Check the presence of WDOPTIMIZER
IF fDir(sDir + "WDOptimizer.EXE", frFile) = "" _OR_ ...
fDir(sDir + "WDTool.WDK", frFile) = "" THEN
Error("WDOptimizer was not installed properly")
RETURN
END

// List the analysis files
sFileList = HListFile()
sFileName = ExtractString(sFileList, i, CR)
WHILE sFileName <> EOT
sPhysicalFileName = {sFileName}..PhysicalName + {sFileName}..Extension
IF fDir(gsDataDir + sPhysicalFileName, frFile) <> "" THEN
// Take the passwords of some protected files into account  
SWITCH Upper(sFileName)
CASE "TOTO": sPwd = "toto"
OTHER CASE: sPwd = ""  
END
IF sPwd <> "" THEN
sCommandLine =
sDir + "WDOptimizer.EXE   /File=" + ...
gsDataDir + sPhysicalFileName + " /Pwd=" + sPwd + " /" + ...
_OptionNum + " /" + sBackup
ELSE
sCommandLine = sDir + "WDOptimizer.EXE   /File=" + ...
 gsDataDir + sPhysicalFileName + " /5 /" + sBackup
END
ExeRun(sCommandLine, exeActive, exeWait)
END
i++
sFileName = ExtractString(sFileList, i, CR)
END
Info("The files found in '" + gsAppName + "' were successfully optimized")
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment