Logo Foltyn Presentation
Table of Contents Previous Page Next Page
Content-Symbol-Img

Ein Programm in der Programmiersprache A program in the programming language
Power Basic 10 for Windows
zum Auswählen von Dateien und Verzeichnissen auf der Festplatte
for selection of files and folders on hard-disk
This is: Power BASIC




Das Programm ist getestet vor der Publikation, aber es kann keine Garantie gegeben werden, dass es fehlerfrei ist The program ist tested before publication, but there can be given no guarantee, that it is free of errors
30. Sept. 2012 Sept 30th 2012

' -------------------------- Dialog Boxes in PB 10 --------------------------------

FUNCTION FolderSelect AS STRING
    ' DISPLAY BROWSE [hParent], [xpos&], [ypos&], title$, start$, flags& TO folder$
    ' DESKTOP GET SIZE TO ncWidth&, ncHeight&
    DIM folder$
    DISPLAY BROWSE %HWND_DESKTOP, 300, 200, _
    "FolderSelect", _                                  ' Title
    "c:\Users\Erich\Documents\", _                     ' starting path
    %BIF_EDITBOX TO folder$
    FUNCTION = folder$
END FUNCTION

FUNCTION FileOpenSelect AS STRING
    ' DISPLAY OPENFILE [hParent], [xpos&], [ypos&], title$, folder$, filter$, _
    ' start$, defextn$, flags& TO filevar$ [,countvar&]
    ' DESKTOP GET SIZE TO ncWidth&, ncHeight&
    DIM countvar&, filevar$, start$
    DISPLAY OPENFILE %HWND_DESKTOP, 300, 200, _
    "FileOpenSelect", _                                ' Title
    "c:\Users\Erich\Documents\" , _                    ' starting folder
    CHR$("BASIC", 0, "*.BAS;*.INC;*.BAK;*.htm", 0), _  ' filter
    start$, _                                          ' starting filename
    ""%OFN_ALLOWMULTISELECT + %OFN_ENABLESIZING + _
    %OFN_FILEMUSTEXIST + %OFN_NOVALIDATE + _
    %OFN_PATHMUSTEXIST TO filevar$, countvar&
    FUNCTION = filevar$
END FUNCTION

FUNCTION FileSaveSelect AS STRING
    ' DISPLAY SAVEFILE [hParent], [xpos&], [ypos&], title$, folder$, filter$, _
    ' start$, defext$, flags& TO filevar$ [,countvar&]
    ' DESKTOP GET SIZE TO ncWidth&, ncHeight&
    DIM countvar&, filevar$, start$
    DISPLAY SAVEFILE %HWND_DESKTOP, 300, 200, _
    "FileSaveSelect", _                                ' Title
    "c:\Users\Erich\Documents\" , _                    ' starting folder
    CHR$("BASIC", 0, "*.BAS;*.INC;*.BAK;*.htm", 0), _  ' filter
    start$, _                                          ' starting filename
    ""%OFN_OVERWRITEPROMPT + _
    %OFN_ENABLESIZING TO filevar$, countvar&
    FUNCTION = filevar$
END FUNCTION