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 / External file functions
  • View the contents of a file in Unicode
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Loads the contents of a text file into any text field or variable (string variable, window edit control, report label field, etc.).. fSaveBuffer is used to extract this file from the buffer.
Example
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget JavaUser code (UMC)PHPAjax
// Charger le contenu du fichier "C:\Temp\MonFichier.txt" dans
// le champ de saisie "SAI_Saisie1"
SAI_Saisie1 = fLoadText("C:\Temp\MonFichier.txt")
Syntax
<Result> = fLoadText(<Name and path of text file> [, <Load mode>])
<Result>: Character string
  • Content of text file,
  • Empty string ("") if an error occurred. To get more details on the error, use ErrorInfo.
<Name and path of text file>: Character string
Name and full (or relative) path of the text file. A UNC path can be used. This file doesn't have to be in TXT format: binary 0s are allowed.
WindowsLinux This parameter can be in Ansi or Unicode format.
iPhone/iPadIOS WidgetMac Catalyst The file path can correspond to a full path or to a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
<Load mode>: Integer constant
Load mode of the file:
foAnsiAnsi file. In this case, <Result> will correspond to an Ansi character string.
foUnicodeUnicode file. In this case, <Result> will correspond to an Unicode character string.

PHP This parameter is not supported. The returned format corresponds to the format supported by the current platform.
Remarks
WINDEVWEBDEV - Server codeReports and QueriesWindowsAndroidAndroid Widget JavaUser code (UMC)Ajax

View the contents of a file in Unicode

To view the contents of a file in Unicode, perform the following operation:
// Charger le contenu du fichier "C:\MesFichiers\MonFichier.XML" dans la chaîne MaChaîne 
MonBuffer is Buffer 
MonBuffer = fLoadText("C:\MesFichiers\MonFichier.XML")
MaChaîne is string Unicode 
MaChaîne = MonBuffer
Info(MaChaîne)
Business / UI classification: Business Logic
Component: wd300std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Exemplo fLoadText
Exemplo fLoadText

//Procurar Arquivo
sFile is string
// Opens the file picker
sFile = fSelect("", "", "Select a file...", "All the files (*.*)" + TAB + "*.*", "*.*")
EDT_nome_arquivo=sFile
//
//Ler Arquivo Texto
EDT_texto=fLoadText(EDT_nome_arquivo)
//Gravar Texto
//
fSaveText(EDT_nome_arquivo,EDT_texto)
//Blog com video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/09/curso-windev-arquivos-018-arquivos_11.html
https://www.youtube.com/watch?v=LlFvXKc9dg4
De matos AMARILDO
11 Sep. 2016

Last update: 09/24/2024

Send a report | Local help