PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Default extension (when creating a file with the fSelCreate constant)
  • Default extension when opening a file
  • Clicking a file found in the file picker
  • Selecting directories
  • "My Documents" directory
  • Operating mode in GO mode and at run time
  • Network drives, manifest and UAC
  • Examples of file pickers
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
Opens the file picker of the current system.
Versions 16 and later
WINDEVLinux This function is now available for the WINDEV applications in Linux.
New in version 16
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WINDEVReports and QueriesJavaUser code (UMC)
// Select a file
SelectedFile is string
SelectedFile = fSelect("C:\Directories", "File.txt", ...
"Select a file", ...
"Text file (*.TXT)" + TAB + "*.txt" + CR + "All" + TAB + "*.*", "txt")
Windows Mobile
// Select a file in "\MyDocuments\Directories"
SelectedFile is string
SelectedFile = fSelect("\Directories", "File.txt", ...
"Select a file", ...
"Text file (*.TXT)" + TAB + "*.txt" + CR + "All" + TAB + "*.*", "txt")
Syntax

Opening a file picker by specifying the initial directory and the file selected by default Hide the details

<Result> = fSelect(<Initial Directory> , <File Selected by Default> , <Picker Title> , <Types of Files> , <Default Extension> [, <Selection Mode>])
<Result>: Character string
  • Full name of selected files. If several files are selected, the names of the files are separated by CR characters (Carriage Return).
  • Full name of file to create.
  • Empty string ("") if no file was selected or created.
<Initial Directory>: Character string (with quotes)
Full or relative path of initial directory (up to 260 characters). This directory name may (or may not) end with "\". The files found in this directory will be displayed in the file picker. If this parameter is an empty string (""), the initial directory will be the current directory.
Versions 15 and later
Windows This parameter can be in Ansi or Unicode format.
New in version 15
Windows This parameter can be in Ansi or Unicode format.
Windows This parameter can be in Ansi or Unicode format.
Windows Mobile Full path of initial directory (up to 260 characters). This directory must correspond to:
  • one of the immediate sub-directories of "\My Documents". This directory must not start with "\".
  • a directory found at the root of a storage card.
    This directory name may (or may not) end with "\". The files found in this directory will be displayed in the file picker. If this parameter is an empty string (""), the initial directory will correspond to the "\My Documents" directory.
<File Selected by Default>: Character string (with quotes)
Name and extension of the file selected by default. If this parameter is an empty string (""), no file will be selected by default.
Versions 15 and later
Windows This parameter can be in Ansi or Unicode format.
New in version 15
Windows This parameter can be in Ansi or Unicode format.
Windows This parameter can be in Ansi or Unicode format.
<Picker Title>: Character string (with quotes)
Caption displayed in the title bar of file picker. If this parameter is an empty string (""), the title of the current WINDEV window will be displayed.
Versions 15 and later
Windows This parameter can be in Ansi or Unicode format.
New in version 15
Windows This parameter can be in Ansi or Unicode format.
Windows This parameter can be in Ansi or Unicode format.
<Types of Files>: Character string (with quotes)
Description of the types of files that can be selected. This description has the following format:
<Types Files> + TAB + <List Extensions> [ + CR + ...
<Types Files 2> + TAB + <List Extensions 2>]

Where:
  • <Types Files>: character string describing the type of file ("BMP (*.BMP;*.RLE)" for example).
  • <List Extensions>: extensions corresponding to the described type ("*.BMP;*.RLE" for example).
For example:
"BMP (*.BMP;*.RLE)"+TAB+"*.BMP;*.RLE"+CR+"Icon (*.ICO)"+TAB+"*.ICO"+CR+"Other"+TAB+"*.GIF;*.TIF;*.JPG"
<Default Extension>: Character string (with quotes)
Extension assigned by default to the selected file (see the Notes).
Versions 15 and later
Windows This parameter can be in Ansi or Unicode format.
New in version 15
Windows This parameter can be in Ansi or Unicode format.
Windows This parameter can be in Ansi or Unicode format.
Versions 16 and later
Linux This parameter is ignored.
New in version 16
Linux This parameter is ignored.
Linux This parameter is ignored.
<Selection Mode>: Optional constant (or combination of constants)
Used to define the selection mode of the picker:
fPathUNICODE
Versions 15 and later
<Result> will be a character string in Unicode format.
Windows Mobile This constant is ignored. <Result> is always in Unicode format.
New in version 15
<Result> will be a character string in Unicode format.
Windows Mobile This constant is ignored. <Result> is always in Unicode format.
<Result> will be a character string in Unicode format.
Windows Mobile This constant is ignored. <Result> is always in Unicode format.
Versions 16 and later
Linux This constant is ignored.
New in version 16
Linux This constant is ignored.
Linux This constant is ignored.
fselCreateOpens the file picker in creation mode ("Save" button).
fselOpenOpens the file picker in opening mode ("Open" button).
fselExistIf this constant is combined:
  • with fselCreate: Returns the name of selected file. If the file already exists, a dialog box displays and allows the user to overwrite the former file.
  • with fselOpen: Returns the name of the selected file if this file exists.
fselMultiOpens the file picker in multi-selection mode. The user can select several files by pressing the "Ctrl" and "Shift" keys.
Windows Mobile This constant is not available.
fselChangeSends the MessageSelect message to the calling WINDEV window whenever a click is performed on a file found in the file picker.
By default, the file picker is called by fselOpen + fselExist.

Opening a file picker by specifying the file selected by default Hide the details

<Result> = fSelect(<Full Path of File Selected by Default> , <Picker Title> , <Types of Files> , <Default Extension> [, <Selection Mode>])
<Result>: Character string
  • Full name of selected files. If several files are selected, the names of the files are separated by CR characters (Carriage Return).
  • Full name of file to create.
  • Empty string ("") if no file was selected or created.
<Full Path of File Selected by Default>: Character string (with quotes)
Full (or relative) path of the file selected by default (including the file name and its extension. If this parameter is an empty string (""), the initial directory will be the current directory and no file will be selected by default.
Versions 15 and later
Windows This parameter can be in Ansi or Unicode format.
New in version 15
Windows This parameter can be in Ansi or Unicode format.
Windows This parameter can be in Ansi or Unicode format.
Windows Mobile Full path of the file selected by default (including the name of the file and its extension). This file must be found:
  • in one of the immediate sub-directories of "\My Documents". This directory must not start with "\".
  • in a directory found at the root of a storage card.
    If this parameter is an empty string (""), the initial directory will correspond to the "\My Documents" directory and no file will be selected by default.
<Picker Title>: Character string (with quotes)
Caption displayed in the title bar of file picker. If this parameter is an empty string (""), the title of the current WINDEV window will be displayed.
Versions 15 and later
Windows This parameter can be in Ansi or Unicode format.
New in version 15
Windows This parameter can be in Ansi or Unicode format.
Windows This parameter can be in Ansi or Unicode format.
<Types of Files>: Character string (with quotes)
Description of the types of files that can be selected. This description has the following format:
<Types Files> + TAB + <List Extensions> [ + CR + ...
<Types Files 2> + TAB + <List Extensions 2>]

  • <Types Files>: character string describing the type of file ("BMP (*.BMP;*.RLE)" for example).
  • <List Extensions>: extensions corresponding to the described type ("*.BMP;*.RLE" for example).
For example:
"BMP (*.BMP;*.RLE)"+TAB+"*.BMP;*.RLE"+CR+"Icon (*.ICO)"+TAB+"*.ICO"+CR+"Other"+TAB+"*.GIF;*.TIF;*.JPG"
Versions 15 and later
Windows This parameter can be in Ansi or Unicode format.
New in version 15
Windows This parameter can be in Ansi or Unicode format.
Windows This parameter can be in Ansi or Unicode format.
<Default Extension>: Character string (with quotes)
Extension assigned by default to the selected file (see the Notes).
Versions 15 and later
Windows This parameter can be in Ansi or Unicode format.
New in version 15
Windows This parameter can be in Ansi or Unicode format.
Windows This parameter can be in Ansi or Unicode format.
Versions 16 and later
Linux This parameter is ignored.
New in version 16
Linux This parameter is ignored.
Linux This parameter is ignored.
<Selection Mode>: Optional constant (or combination of constants)
Used to define the selection mode of the picker:
fPathUNICODE
Versions 15 and later
<Result> will be a character string in Unicode format.
Windows Mobile This constant is ignored. <Result> is always in Unicode format.
New in version 15
<Result> will be a character string in Unicode format.
Windows Mobile This constant is ignored. <Result> is always in Unicode format.
<Result> will be a character string in Unicode format.
Windows Mobile This constant is ignored. <Result> is always in Unicode format.
Versions 16 and later
Linux This constant is ignored.
New in version 16
Linux This constant is ignored.
Linux This constant is ignored.
fselCreateOpens the file picker in creation mode ("Save" button).
fselOpenOpens the file picker in opening mode ("Open" button).
fselExistIf this constant is combined:
  • with fselCreate: Returns the name of selected file. If the file already exists, a dialog box displays and allows the user to overwrite the former file.
  • with fselOpen: Returns the name of the selected file if this file exists.
fselMultiOpens the file picker in multi-selection mode. The user can select several files by pressing the "Ctrl" and "Shift" keys.
Windows Mobile This constant is not available.
fselChangeSends the MessageSelect message to the calling WINDEV window whenever a click is performed on a file found in the file picker.
By default, the file picker is called by fselOpen + fselExist.
Remarks

Default extension (when creating a file with the fSelCreate constant)

The extension of a selected file (file to create) differs according to:
  • <Default Extension>,
  • the extension entered by the user.
For example, the table below presents the extension that will be taken into account according to <Default Extension> and to the extension entered by the user:
<Default Extension>Extension entered by the userExtension taken into account when creating the file
".TXT""File.BMP"
BMP is a valid and recognized extension.
"File.BMP"
".TXT""File.PAF"
PAF is an invalid extension. The name of the file will be completed by the <Default Extension>.
"File.PAF.TXT"
".TXT""File"
No extension is entered. The <Default extension> is used.
"File.TXT"
"" (empty string)"File.BMP"
BMP is a valid and recognized extension.
"File.BMP"
"" (empty string)"File.PAF"
PAF is an invalid extension. The name of the file will be completed by the first extension found in the "Type of File" displayed.
Type of file displayed: "Text (*.TXT;*.DOC)"
"File.PAF.TXT"
"" (empty string)"File.PAF"
PAF is an invalid extension. The type of the file being "*.*", the invalid extension is kept.
Type of file displayed: "All the files(*.*)"
"File.PAF"
"" (empty string)"File"
No extension is entered. The extension used is the first extension found in the "Type of File" displayed.
Type of file displayed: "Text (*.TXT;*.DOC)"
"File.TXT"
"" (empty string)"File"
No extension is entered. The type of the file being "*.*", the name of the file is kept without extension.
Type of file displayed: "All the files(*.*)"
"File"

Default extension when opening a file

The extension of a selected file (file to open) corresponds to the extension selected by default when opening the file picker. <Default Extension> must correspond to the letters corresponding to the extension ("lst" to select "*.lst" by default).

Clicking a file found in the file picker

To run a specific process when clicking a file found in the file picker, branch an event on the message WM_USER + 600 (1624). When this message is received:
  • the lParam variable contains the address of the selected file
  • the wParam variable contains the address of the selected file.
For example, you have the ability to play the sound selected in the file picker (see Example 2, available by clicking the "Example" link at the top of help page).
WINDEVReports and QueriesJavaUser code (UMC)

Selecting directories

fSelect is used to select files. To select a directory, use fSelectDir.
Windows Mobile

"My Documents" directory

If the initial directory corresponds to "My Documents":
  • the file picker will display all the files found in "My Documents" and in its immediate sub-directories.
  • the "Folder" option of the file picker will correspond to "All folders".
Windows Mobile

Operating mode in GO mode and at run time

In GO mode (simulation on the development computer), during the call to fSelect:
  • the file picker of the development computer is displayed.
  • <Initial Directory> is ignored. The initial directory corresponds to the current directory.
  • <Result> contains a path in the format of the development computer (for example: "C:\MyDirectories").
The differences between GO mode (simulator) and real use are presented in Differences between GO mode and real use.
Windows

Network drives, manifest and UAC

In Windows Vista and later, if the UAC is enabled and if the executable is generated with a manifest requesting privileges (see Generating the executable), the file picker opened by fSelect will have no access to the network drives associated with the user who opened the Windows session. See FAQ about Windows Vista and later for more details.
WindowsLinuxWindows Mobile

Examples of file pickers

Windows The Windows file picker is as follows:
Windows file picker
Note: In Windows Vista (and later), the file picker of Windows Vista is opened.
Windows Mobile The Pocket PC file picker is as follows:
Windows Mobile file picker
In Pocket PC, the file picker is used to select the files found:
  • in the "\My Documents" directory or in one of its immediate sub-directories.
  • in a directory found at the root of a storage card.
Therefore, fSelect can only be used to select a file found in one of these directories.
Versions 16 and later
Linux The Linux file picker is as follows:
Linux file picker
New in version 16
Linux The Linux file picker is as follows:
Linux file picker
Linux The Linux file picker is as follows:
Linux file picker
Components
WINDEVReports and Queries wd230std.dll
Windows Mobile wp230std.dll
Java wd230java.jar
Linux wd230std.so
Minimum required version
  • Version 9
This page is also available for…
Comments
Seleciona Um Arquivo Xml
sFile is string
sFile = fSelect("", "", "Seleciona Um Arquivo Xml", "Xml" + TAB + "*.xml", "*.xml")
EDT_auditoria=fLoadText(sFile)

// BLOG COM VIDEO E EXEMPLO


http://windevdesenvolvimento.blogspot.com.br/2017/06/aula-1190-windev-arquivos-021-procurar.html

https://www.youtube.com/watch?v=XlZEAM2H2Yc
De matos
Jun. 27 2017