Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


How to Use FileListBox to Display Directories Only in the Dialog Editor

Keywords:      FileListBox   IntControl(4,

Question:

In one of my Wil Scripts the user should choose a directory. Is it possible to set up the AskFileName function in a way he can choose a Directory and not a File?

Answer:

Here's the closest thing...
IntControl(4, 0, 0, 0, 0)
disks=`c:\*.`
HomeDirDialogFormat=`WWWDLGED,5.0`
HomeDirDialogCaption=`Choose the directory`
HomeDirDialogX=284
HomeDirDialogY=85
HomeDirDialogWidth=159
HomeDirDialogHeight=118
HomeDirDialogNumControls=3
HomeDirDialog01=`6,16,80,54,FILELISTBOX,disks,DEFAULT`
HomeDirDialog02=`62,84,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Ok",1`
HomeDirDialog03=`6,2,148,DEFAULT,VARYTEXT,disks,""`
ButtonPushed=Dialog("HomeDirDialog")

disks=DirGet() ;;;;;;;;;;Da magic
message(`You chose`,disks)

Article ID:   W12841
Filename:   FileListBox to Display Directories Only.txt