ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Miscellaneous WINDEV functions
  • Writing into a INI file in Unicode mode
  • Miscellaneous
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
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
// Mémorisation du produit sélectionné dans le .INI
INIWrite("USER", "LastProd", ...
	NumToString(ListSelect(LISTE_Produit)), ...
	fCurrentDir() + "\Port.INI")
Syntax
<Result> = INIWrite(<Section> [, <Keyword> [, <Value> [, <File>]]])
<Result>: Boolean
  • True if the operation was performed,
  • False otherwise.
<Section>: Character string
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
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.
iPhone/iPadIOS WidgetMac Catalyst This parameter must be specified.
<Value>: Optional character string
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 text cannot contain the TAB character.
iPhone/iPadIOS WidgetMac Catalyst This parameter must be specified.
<File>: Optional character string
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 searched for 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.
AndroidAndroid Widget Full name of file to complete (with its extension). This parameter can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case sensitive.
  • If this parameter is not specified, the file used will be the one named like the project and found in the application runtime directory (current directory). The file will be created if it does not exist.
  • If only the path is not specified , the file will be searched for in the application runtime directory (current directory).
Reminder: In Android, the file system is read-only on the device and on the emulator. An application can only write to its installation directory or one of its subdirectories, as well as to the external memory (SDCard).
iPhone/iPadIOS WidgetMac Catalyst This parameter is mandatory. This parameter can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
Reminder: On iPhone or iPad, an application has the rights to write to its installation directory or one of its subdirectories
Remarks

Writing into a INI file in Unicode mode

Your application operates in Unicode mode ("Use UNICODE strings at runtime" 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(gsFicINI, foUnicode) // crée gsFicINI avec un BOM UNICODE
INIWrite("Français", "Pays", "France",gsFicINI)
INIWrite("??","??", "??", gsFicINI)

Miscellaneous

  • We do not advise you to write into the WIN.INI file.
  • To write to the registry, use registry-specific functions: RegistrySetValue, etc.
  • INI files are limited to 64 Kb (under Windows 98).
Component: wd300std.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

Last update: 03/27/2025

Send a report | Local help