Promotic
WikipediaLinkedInYoutubeTwitterFacebook

InputBoxForFilePath - method of object Pm

Description:
Input window for displaying and selection of files/folders.
Syntax:
InputBoxForFilePath(sTitle As String, nStyle As Long, sFilePath As String, sExt As String, sFilter As String) As Boolean
Calling:
b = Pm.InputBoxForFilePath(sTitle, nStyle, sFilePath, sExt, sFilter)
Parameters:
sTitle(String) Title of the input window.
nStyle(Long) Bit attributes definig window type and content.

Hexadecimal numbers can be entered by adding a prefix: for JavaScript it is 0x and for VBScript it is &H. For example, 0x10 or &H10 represents decimal 16 in hexadecimal notation.

It is possible to enter the following styles or their combinations as a sum:

&H100 - Cannot go through the subfolders.
&H200 - Cannot go through the parent-folders.
&H300 - Cannot change the folder.
&H400 - Selected file must exist.
&H1000 - Selected file mustn't exist.
&H800 - Confirmation is requested.
&H2000 - Folders are not displayed.
&H4000 - Only folders are displayed.
&H10000000 - Window will be "Always on top".
&H8000 - The window can be closed only by selecting the file. It means that if the folder (marked in blue) is selected, then the window cannot be closed by the OK button.
sFilePath(String) It is recommended to use the PROMOTIC path syntax - see PROMOTIC path to files and folders.
 
on the calling: the full path to the file or folder (for the window initialization).
after the calling: the selected file or folder.
sExt(String) Default extension of the selected file.
sFilter(String) String enabling the filtering of the file content. Examples:
- display of all files: sFilter="All files (*.*)|*.*||"
- display files with the extension '.TXT': sFilter="TXT files (*.TXT)|*.TXT||"
- display files with the extension '.TXT' and '.INI': sFilter="TXT files (*.TXT)|*.TXT|INI files (*.INI)|*.INI||"
Return Values:
true - If the window has been closed by the OK button.
false - If the window has been closed by the Cancel button.
Note:
It enables depending on the nStyle parameter to go through folders on the disk and to select (or enter) the file or the folder. If the window is closed by the OK button, then the full path with the filename is stored in the sFilePath.
 
This method is not functional for Web panels in JavaScript language (and therefore it is not working in Web panels).
Example:
VBScriptSelect and copy to clipboard

Dim sFile, sFilter
sFile = "#appres:triangle.jpg"
sFilter = "Images (*.jpg)|*.jpg|All files (*.*)|*.*||"
If Pm.InputBoxForFilePath("Choose a image", &H200, sFile, "jpg", sFilter) Then
  Pm.Debug "file = " & sFile
End If
PROMOTIC 8.3.27 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- InputBoxForFilePath
 
 
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice