PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP


  • Writing into a INI file in Unicode mode
  • Various
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
Writes a specific value into an INI file (or into a file structured like an .INI file). You can:
  • write the value of a keyword found in a specific section,
  • create or delete a keyword,
  • create or delete a section.
Example
// Store the selected product in the .INI
INIWrite("USER", "LastProd", ...
NumToString(ListSelect(LIST_Product)), ...
fCurrentDir() + "\Port.INI")
WEBDEV - Server codePHPAjax
Example of .INI file:
[WD examples]
Name1 = WDInstall
Name2 = WDBench
[Description of WDInstall]
Caption = Use the control panel of Windows
LST = 43
Page = 12
// Write into the [WD examples] section
INIWrite("WD examples", "Name3", "WDExample", "C:\Temp\ExamplesLST.INI")
Syntax
<Result> = INIWrite(<Section> [, <Keyword> [, <Value> [, <File>]]])
<Result>: Boolean
  • True if the operation was performed,
  • False otherwise.
<Section>: Character string (with quotes)
Name of section where the write operation will be performed. The section is automatically created if it does not exist.
Note: This name cannot contain the "-" character.
<Keyword>: Optional character string (with quotes)
Name of keyword containing the information to write. This keyword s automatically created if it does not exist.
The section will be deleted if this parameter is an empty string ("") or if it corresponds to NULL.
<Value>: Optional character string (with quotes)
Text to write for the keyword and the specified section. The keyword will be deleted if this parameter is an empty string ("") or if ti corresponds to NULL.
Note: This name cannot contain the TAB character.
PHP This name cannot contain the quotation mark character.
<File>: Optional character string (with quotes)
Full name of file to complete (with its extension).
  • The WIN.INI file will be used if this parameter is not specified.
  • If only the path is not specified, the file will be sought in the Windows directory.
  • The directory will not be created if it does not exist.
  • The file will be created if it does not exist in the specified directory.
PHP Full name of file to fill (with its extension).
  • The PHP.INI file will be used if this parameter is not specified.
  • If only the path is not specified , the file will be sought in the current directory. The file will be created if it does not exist.
Remarks
Versions 17 and later

Writing into a INI file in Unicode mode

Your application operates in Unicode mode ("Use UNICODE strings at run time" checked in the "Unicode" tab of configuration description).
In this case, to write into an INI file, this INI file must be in Unicode format, which means that it must have a Unicode BOM header.
Example:
fCreate(gsINIFile, foUnicode) // creates gsINIFile with BOM UNICODE
INIWrite("French", "Country", "French",gsINIFile)
INIWrite("中国","国家", "中国", gsINIFile)
New in version 17

Writing into a INI file in Unicode mode

Your application operates in Unicode mode ("Use UNICODE strings at run time" checked in the "Unicode" tab of configuration description).
In this case, to write into an INI file, this INI file must be in Unicode format, which means that it must have a Unicode BOM header.
Example:
fCreate(gsINIFile, foUnicode) // creates gsINIFile with BOM UNICODE
INIWrite("French", "Country", "French",gsINIFile)
INIWrite("中国","国家", "中国", gsINIFile)

Writing into a INI file in Unicode mode

Your application operates in Unicode mode ("Use UNICODE strings at run time" checked in the "Unicode" tab of configuration description).
In this case, to write into an INI file, this INI file must be in Unicode format, which means that it must have a Unicode BOM header.
Example:
fCreate(gsINIFile, foUnicode) // creates gsINIFile with BOM UNICODE
INIWrite("French", "Country", "French",gsINIFile)
INIWrite("中国","国家", "中国", gsINIFile)

Various

  • We do not advise you to write into the WIN.INI file.
  • To write into the registry, use the functions specific to the registry: RegistrySetValue, etc.
  • The INI files are limited to 64 KB (in Windows 98).
Component : wd250std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Optional Parameter File
"win.ini" is not used, if no Parameter for file is defined on Windev mobile...
Werner
11 Jan. 2020