Documentation by John Kelly  QFILEDIALOG

QFILEDIALOG Component

This is a new custom component in RAPIDQ2.INC. Creates an Open or Save Dialog box that is set by Mode property. The dialog box is sizeable and allows selection of multiple files. If you use it to save a file it will ask if you want to overwrite the existing file. There will be icons for quick links to the desktop, network locations, and myDocuments folder.  See limitations.

QFileDialog Properties
FieldTypeR/WDefault




CaptionSTRINGRW"Open"
DefaultExtSTRING     
Default extension that will be automatically added to filename if user doesn't include it.
RW
FileNameSTRING     Returns file name with path informationRW
FileTitleSTRING     Returns the file name without path informationR
Files()Array of STRING   If Mode = fdOpen,and MultiSelect = True,then the array has a list of selected files. Files(0) is the directory, Files(1) is the first file name without the path RWAll Files|*.*
FilterSTRINGRWAll Files|*.*
FilterIndexINTEGER        1st index is 0RW1
InitialDirSTRINGRW 
ModeINTEGER     sets whether the dialog box will be an Open dialog or Save. 
Valid arguments:
fdOpen = 0
fdSave = 1
RWfdOpen
MultiSelectINTEGER   If set to true and Mode = fdOpen, then the user can select up to 256 filesRWFalse
NoChangeDirINTEGER   If set to true the QFileDialog will not change the current directory RWFalse
ParentLONG        This is the parent form handle, can be nullRWNull
SelCountINTEGER 
   Number of files the user selected when Multiselect = true
R0
WarnIfOverWriteINTEGER 
   Flag for warning if you want to overwrite the file when mode is fdSave
RWTrue

QFileDialog Methods
MethodTypeDescriptionParams




ExecuteFUNCTIONReturns TRUE (user picked files) or FALSE (user picked Cancel)0


QFileDialog Examples
$INCLUDE "RapidQ2.inc"
DIM i as integer
DIM fDialog as qfiledialog
fDialog.Caption = "QfileDialog test"
fDialog.FileName= "test.txt"
fDialog.InitialDir = "C:\RapidQ"
fDialog.MultiSelect = 1
IF fDialog.Execute THEN
  IF fDialog.MultiSelect THEN
     for i = 0 to fDialog.SelCount
        ShowMessage fDialog.Files(i)	'item #0 is the directory
     next i
  ELSE
     ShowMessage "file name & path =" + fDialog.FileName
     ShowMessage "file name no path =" + fDialog.FileTitle
  END IF
END IF

Prev Component Contents Next Component