FILELISTBOX multiply file extension mask

Started by wlodekd, July 25, 2013, 06:47:26 AM

Previous topic - Next topic

wlodekd

Dear Forum,
FILELISTBOX
1. How can I define file mask to include for example all files with .txt and .pdf extension in specific directory.
2. How can I define mask to show files only and not [DIRECTORIES]

Thanks Walter

Deana

The FileListBox doesn't support multiple file extensions or the ability to show only files.

There are a few different ways this can be accomplished.

Using a Itembox along with FileItemize:

Code (winbatch) Select
DocsDir = ShortCutDir('Personal')
DirChange( DocsDir )
ibVariable1 = FileItemize("*.txt|*.pdf")

MyDialogFormat=`WWWDLGED,6.2`

MyDialogCaption=`Itembox Sample`
MyDialogX=002
MyDialogY=059
MyDialogWidth=478
MyDialogHeight=353
MyDialogNumControls=003
MyDialogProcedure=`DEFAULT`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`
MyDialogConfig=0

MyDialog001=`111,315,036,012,PUSHBUTTON,"PushButton_OK",DEFAULT,"OK",1,10,32,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`271,317,036,012,PUSHBUTTON,"PushButton_Cancel",DEFAULT,"Cancel",0,20,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`023,023,420,278,ITEMBOX,"ItemBox_1",ibVariable1,DEFAULT,DEFAULT,30,DEFAULT,DEFAULT,DEFAULT,DEFAULT`

ButtonPushed=Dialog("MyDialog")


Using AskItemList:

Code (winbatch) Select

types="TXT Files|*.txt|PDF Files|*.pdf"
fn1=AskFilename("SelectFile", "C:\WinBatch", types, "Sol.wbt", 1)
Message("File selected was", fn1)

Deana F.
Technical Support
Wilson WindowWare Inc.