PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
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
InitParameter (Function)
In French: InitParamètre
Initializes the management of persistent values. Specifies the location used to store:
  • the values of the persistent controls.
  • the size and position of the controls and windows.
  • the values managed by SaveParameter and LoadParameter.
Note: The initialization of persistent values is "global". Therefore, if a component initializes the management of persistent values, the management of persistent values will be initialized for the application that uses the component.
Versions 17 and later
Android This function is now available for the Android applications.
New in version 17
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 19 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 19
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
WINDEVReports and QueriesAndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 AppUser code (UMC)
// Configure the persistent values
// in a .XML file that depends on the user
InitParameter(paramXML, "Param_" + USER + ".xml")
WINDEVReports and QueriesWindows MobileUniversal Windows 10 AppUser code (UMC)
// Configure the persistent values
// in a registry key with a version number
InitParameter(paramRegistry, ProjectInfo(piRegistry) + "\3.51")
// other possibility:
InitParameter(paramRegistry, "HKEY_CURRENT_USER\Software\DDSoft\DDTool\3.51")
WINDEVReports and QueriesAndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 AppUser code (UMC)
// Configure the persistent values
// Configure via a string
MyString is string
MyString = fLoadText("MyFile.xml")
InitParameter(paramString, MyString)
Syntax
<Result> = InitParameter(<Initialization Mode> [, <Source of Values>])
<Result>: Character string
Initialization mode used before the call to InitParameter. <Result> has the following format:
<Initialization Mode> + TAB + <Source of Values>
<Initialization Mode>: Integer constant
Type of backup for the persistent data:
paramIniThe parameters will be saved in a [Global] section of a file in .INI format.
If this option is selected:
  • the INI file is named <Project Name>.INI by default. This file is created in the directory of the executable.
    iPhone/iPad This file is created in the "/Library" directory of the application.
  • <Source of Values> corresponds to the name of .INI file to use. The size of the file is limited to 64 KB in Windows 98 or Me.
    If this directory is not specified, the file is created in the executable directory.
    iPhone/iPad If this directory is not specified, the file is created in the "/Library" directory of the application.
paramRegistryThe parameters will be saved in the registry.
If this option is selected:
  • by default, the entry used corresponds to the result of ProjectInfo(piRegistry) (which means HKEY_CURRENT_USER\Software\<Company>\<Project Name>)
    <Company> corresponds to the company specified when creating the executable. If this name is not specified, <Company> corresponds to "WINDEV applications".
  • in Test mode, the path used in the registry is as follows: HKEY_CURRENT_USER\SOFTWARE\PC SOFT\WinDev\23\TestMode\<Project Name>.
  • <Source of Values> corresponds to the registry entry to use.
Java <Source of Values> will be ignored. If this mode is chosen to store the persistent data, the support used for backup depends on the operating system on which the application is run. In Windows, the data is saved in the registry (HKEY_CURRENT_USER\Software\JavaSoft\Prefs) and in Mac OSX, the data is saved in the system preferences.
Versions 17 and later
AndroidAndroid Widget <Source of Values> will be ignored. If this mode is chosen to store persistent data, the data is stored in the system preferences.
New in version 17
AndroidAndroid Widget <Source of Values> will be ignored. If this mode is chosen to store persistent data, the data is stored in the system preferences.
AndroidAndroid Widget <Source of Values> will be ignored. If this mode is chosen to store persistent data, the data is stored in the system preferences.
ParamXMLThe parameters will be saved in a file in .XML format.
If this option is selected:
  • the XML file is named <Project Name>.XML by default. This file is created in the directory of the executable.
    iPhone/iPad This file is created in the "/Library" directory of the application.
  • <Source of Values> corresponds to the name of the .XML file to use.
    If this directory is not specified, the file is created in the executable directory.
    iPhone/iPad If this directory is not specified, the file is created in the "/Library" directory of the application.
Windows Mobile This parameter is not supported in this version.
Versions 17 and later
AndroidAndroid Widget This parameter is only supported starting with version 2.2 of Android. A fatal error will occur if this parameter is used with an earlier version.
New in version 17
AndroidAndroid Widget This parameter is only supported starting with version 2.2 of Android. A fatal error will occur if this parameter is used with an earlier version.
AndroidAndroid Widget This parameter is only supported starting with version 2.2 of Android. A fatal error will occur if this parameter is used with an earlier version.
paramStringThe parameters will be read in a XML string. <Source of Values> (mandatory parameter) must be a string variable.
In this case, the parameters are not saved in an XML file but in the string variable.
This constant can be used to retrieve parameters coming from an HTTP server (parameters returned by HTTPRequest for example).
Windows Mobile This parameter is not supported in this version.
Versions 17 and later
AndroidAndroid Widget This parameter is only supported starting with version 2.2 of Android. A fatal error will occur if this parameter is used with an earlier version.
New in version 17
AndroidAndroid Widget This parameter is only supported starting with version 2.2 of Android. A fatal error will occur if this parameter is used with an earlier version.
AndroidAndroid Widget This parameter is only supported starting with version 2.2 of Android. A fatal error will occur if this parameter is used with an earlier version.
<Source of Values>: Optional character string
This parameter depends on the selected initialization mode.
Related Examples:
WD Persistence Training (WINDEV): WD Persistence
[ + ] This example presents the use of InitParameter, LoadParameter and SaveParameter.
These functions are used to configure the backup of controls, variables and other parameters.
This example is divided into three parts:
- The configuration
- The manual management of variables (SaveParameter and LoadParameter)
- The optimization
1°) Configuration

The configuration window enables you to modify the location of the backup of parameters (registry, INI file, XML file) as well as its path (registry key or file path).
2°) Manual management of the variables
The manual management enables you to save the content of the variables via SaveParameter and to restore them via LoadParameter. Each parameter is identified by a name. These values are saved at the location defined in the configuration window.
3°) The optimization
This window explains how to optimize your code to avoid the slowness caused when the saved values are restored. Indeed, when restoring the value of a control, its modification code is run. If you have long processes (queries with parameters for instance), this window shows you how to speed up the loading of the window.
Components
WINDEVReports and Queries wd230std.dll
Windows Mobile wp230std.dll
Java wd230java.jar
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment