AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de Windows / Funciones varias de WINDEV
  • Writing into a INI file in Unicode mode
  • Miscellaneous
  • Windows Vista (and later)
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
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.
Ejemplo
// Store the selected product in the .INI
INIWrite("USER", "LastProd", ...
	NumToString(ListSelect(LIST_Product)), ...
	fCurrentDir() + "\Port.INI")
WINDEVWEBDEV - Código ServidorReportes y ConsultasCódigo de Usuario (UMC)PHPAjax
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")
Sintaxis
<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.
PHP This name cannot contain the quotation mark 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.
Java Full name of file to complete (with its extension).
  • If this parameter is not specified, the file used will be the one named like the project and found in the runtime directory of application. 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 runtime directory of application.
AndroidWidget Android 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).
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 searched for in the current directory. The file will be created if it does not exist.
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
Observaciones

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(gsINIFile, foUnicode) // creates gsINIFile with BOM UNICODE
INIWrite("French", "Country", "French",gsINIFile)
INIWrite("??","??", "??", gsINIFile)

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).
WINDEVReportes y ConsultasCódigo de Usuario (UMC)

Windows Vista (and later)

The programming standards of Windows do not advise you to write:
  • into the WIN.INI file
  • into the system directories (Windows directory, "Program Files" directory, ...).
In Windows Vista (and later) with the UAC mechanism enabled, the administrator privileges are required to perform these operations. If the application does not have the required administrator privileges, the UAC mechanism will redirect the files (called virtualization) to a directory specific to the user who uses the application (C:\Users\<LOGIN>AppData\Local\VirtualStore\Windows\). The files can be read again by INIRead used in the same application. This virtualization mechanism of files is proposed by Windows Vista (and later) for compatibility and it is not available in 64 bits.
Warning If the INI file is automatically virtualized by Windows Vista (and higher), the INI file cannot be shared between several applications (especially if these applications use different privileges).
Programming tip: To create an INI file without requiring administrator privileges, we recommend:
  • do not use the WIN.INI file (the <File> parameter must be specified),
  • avoid writing to the Windows directory or to the "Program Files" directory,
  • use the system directory of the application (returned by SysDir with the srAppDataCommun constant, for example).
Componente: wd300std.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Optional Parameter File
"win.ini" is not used, if no Parameter for file is defined on Windev mobile...
Werner
11 01 2020

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local