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
  • Reading the persistent values
  • 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
Reads the content of an INI file (or the content of a file structured like .INI files). You can get:
  • the value of a keyword found in a specific section,
  • the list of keywords found in a section,
  • the list of file sections.
Example of .INI file
[WD examples]
Name1 = WDInstall
Name2 = WDBench
[Description of WDInstall]
Caption = Use the control panel of Windows
LST = 43
Page = 12
Reportes y Consultas
// Read in the [WD Examples] section
INIRead("WD Examples", "Name2", "", "C:\Temp\ExamplesLST.INI")
// Default choice read in the .INI
nProduct is int = Val(INIRead("USER", ...
"LastProd", "", fExeDir() + "\Port.INI"))
IF nProduct > 0 THEN ListSelectPlus(LIST_Product, nProduct)
Sintaxis
<Result> = INIRead(<Section> [, <Keyword> [, <Not found> [, <File>]]])
<Result>: Character string
  • Text sought or list of keywords found in the section (the keywords are separated by CR characters),
  • List of file sections (the sections are separated by CR characters).
  • Content of <Not found> in the following cases:
    • the string corresponding to the keyword is empty,
    • the keyword is not found,
    • the file is not found.
  • Empty string (if <Not found> is not specified or if it is equal to an empty string) in the following cases:
    • the string corresponding to the keyword is empty,
    • the keyword is not found,
    • the file is not found.
<Section>: Character string
Name of section to read in the INI file.
If this parameter and <Keyword> correspond to an empty string, <Result> contains the list of sections found in the file, separated by CR characters.

Remark: This name cannot contain the character "-"..
<Keyword>: Optional character string
Name of the keyword containing the information to read.
If this parameter is an empty string, <Result> contains the list of keywords found in <Section>, separated by CR characters.
<Not found>: Optional character string or optional integer
Text or integer to be returned if the requested keyword has not been read. This parameter corresponds to an empty string by default.
<File>: Optional character string
Full name of file to read (with its extension).
  • The WIN.INI file will be used if this parameter is not specified.
  • If only the name of the file is specified, the specified file will be searched for in the directory of Windows.
Observaciones

Reading the persistent values

To read the persistent values in a INI file (saved with SaveParameter), use LoadParameter.

Miscellaneous

  • To read the registry, use the registry-specific functions: RegistryQueryValue, ...
  • INI files are limited to 64 KB.
  • TSE: The INIRead function uses the Windows directory by default..
    Note: Until version 21, the INIRead function used the user's Windows directory by default..
    Reminder: In TSE mode, access to a '.INI' file with a relative name is not recommended. We advise you to use one of the following solutions:
Reportes y Consultas

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\). Files can be read again with 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).
Clasificación Lógica de negocio / UI: Lógica de negocio
Componente: wd300std.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
LER CAMPOS INI E TXT
EDT_Retorno_cStat=INIRead("EVENTO001","cStat","",EDT_localizacao_arquivo_retorno_carta)
EDT_Retorno_nProt=INIRead("EVENTO001","nProt","",EDT_localizacao_arquivo_retorno_carta)
//===
[EVENTO001]
cStat=135
//BLOG COM VIDE E EXEMPLO

AULA 1312 WINDEV DICAS 048 INIREAD

http://windevdesenvolvimento.blogspot.com.br/2017/12/aula-1312-windev-dicas-048-iniread.html

https://www.youtube.com/watch?v=5F7zQU9sBYQ
De matos
22 12 2017

Última modificación: 28/03/2025

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