Page 1 of 1

File Dialog

Posted: July 7th, 2020, 4:50 pm
by juanf11
Hello.-

Would it be possible to add to CSPro a File Dialog that lets you choose a certain file so that its route becomes a string in the CSPro application?

This would allow for more flexible data syncing with files.

Thanks.

Re: File Dialog

Posted: July 8th, 2020, 8:46 am
by Gregory Martin
You can build one yourself with a little CSPro:
list string data_files;
dirlist(data_files, "../Data/*.csdb");

if data_files.length() > 0 then

    numeric
selection = data_files.show("Which file do you want to sync?");

   
if selection > 0 then
        // do something with data_files(selection)
   
endif;

endif;

Re: File Dialog

Posted: July 8th, 2020, 6:33 pm
by juanf11
Hello Gregory.

Using a weird mix of direxist, dircreate, the below code and execsystem with explorer.exe to said folder and some pausing errmsgs I've managed to do kind of what I wanted to with some extra steps.

This is because the files I wanted to select through a file dialog would be some which don't really 'belong' to the CSPro environment but are part of the user's work tools (which mean they keep it under their file repertoire.

It's a long workaround but I managed to do it, nonetheless I insist it would be a good feature to have, so I hope it will be taken into consideration.

Thanks. -