DosFileLookup in Directory mode does not select Default Directory

Hi Guys

I have a strange behaviour with abc dosfilelookup

I am setting the directory in the object embed ask procedure for the control.

I am setting the directory with my lookupno.defaultdirectory = …

The code works when I am setting a file mode but it does not work when selecting a directory mode.

I have tested with a \ at the end of the variable and not.

Any ideas?

Are you sure its not working?

The reason I ask is because the Select Folder is a very different dialog that below the Tree just shows the Child directory name not the full path. In my example code below the Folder entry just shows “Win” not the full path. And it does not even scroll the tree down to “Win” it starts at the top.

Suggest you add code like mine to test by showing the selected directory then just press enter when it opens and it should show your default, mine did. I’m using 11.1.13815 on Windows 10

       IF FILEDIALOG('test', fn2", , FILE:Directory + FILE:LongName ) THEN 
          Message('fn2"=' & Fn2" )


I really don’t like changing the path with SetPath() before calling FileDialog.
I prefer to use File:KeepDirectory in the options.

I agree with Carl, it should default the folder selection to either the current path or the value of the variable passed to the function that receives the results.

MyPath cstring(FILE:MaxFilePath)
  MyPath = 'c:\temp'
  FILEDIALOG('Select folder',MyPath,,FILE:Directory+FILE:KeepDir+FILE:LongName)

Perhaps there is something in the DosFileLookup class or template that is interfering.

1 Like

Ahhh I think you are right there. It’s not going to lower folder. Not great !

Any way to get round this ?