C10: Problems with FILEDIALOG

I am a Clarion newbie and I am having two problems with the FILEDIALOG command

  1. It is too narrow to display the full path, and it looks like it was borrowed from 16-bit Windows

  2. When I click the “OK” button I have to do so twice. The “Cancel” button works correctly.

Here is part of my code:

    OF ?FolderButton
        CASE EVENT()
        OF EVENT:Accepted
            BrowseBase = GETINI('Fixer', 'Project',PATH() & '\',PATH() & '\Fixer.ini')
            FILEDIALOG('Choose Project Folder',BrowseBase,,FILE:Directory) 
            IF ~BrowseBase                    
                BrowseBase = PATH()                    
            IF BrowseBase[LEN(CLIP(BrowseBase))] ~= '\'
                BrowseBase = BrowseBase & '\'
            PUTINI('Fixer', 'Project', BrowseBase,PATH() & '\Fixer.ini')

Is this a known problem?
Can I use the current Windows File Dialog instead, without jumping through too many hoops?

You can add the FILE:LongName switch to use the “new” style. Not sure why they leave the “old” way as default in C10.

IF FILEDIALOG('Choose Project Folder',BrowseBase,'*.*',FILE:Directory+File:LongName)

There are other useful switches you can use, as described in the documentation.

1 Like

You probably want FILE:KeepDir depending on what you are doing. That keeps your application Path the same no matter where they navigate in FileDialog.
Also, File:AddExtension can be nice on Save requests.

1 Like