LoadDialog |
File$ = LoadDialog(Title$, Filename$, Filter$) |
|
Parameters: Title$ = Title of dialog Filename$ = Set the name of fileOf File Filter$ = File Type Filter
|
Returns:
File$= The full path & filename of the selected file. If no file was selected, it'll return a NULL string |
|
LoadDialog opens a windows file dialog.
FACTS:
* The LoadDialog function returns a NULL string if no file was selected or the user selects cancel.
* LoadDialog is not asynchronous, so the PlayBasic application will halt while the dialog is open.
|
|
Example Source: Download This Example ; Inlcude the Dialogs library in this program #Include "PBDialogs" ; Title Of the Dialog Title$="Load A Text File" ; Pre-seed the file name we're expecting to find Filename$="Some Cool FIle.txt" ; Filter$="" ; No Filter show all files Filter$ ="(*.TXT)|*.TXT" ; Only TXT files ; Filter$ ="(*.PNG)|*.PNG" ; Only PNG files ; Filter$ ="(*.BMP)|*.BMP" ; Only BMP Files ; Filter$ ="(*.Jpeg)|*.JPG" ; Only JPG files ; Filter$ ="(*.Images)|*.JPG;*.bmp;*.PNG;*gif" ; Mixture of image files ; Call the Load Dialog File$=LoadDialog(Title$,Filename$,Filter$) ; Display the file you selected Print "You Selected " ; Display the Info about this file$ If FileExist(file$) Print "Path:"+FIle$ Print "Size:"+Str$(FileSize(File$))+" Bytes" Else Print "No file Was Selected" EndIf // Display the screen & wait for a key press to end Sync WaitKey |
|