Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Blue GUI: Open and Save dialog questions

Author
Message
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 15th Sep 2006 14:15
Hi. Two questions about loading and saving using BlueGUI for anyone that can help:

Firstly, I have a question about saving. If I use the command file$=savedialog(.....), then the string 'file$' is the full path of the file the user saved. Is there a way, though, to access just the name of the file name that was saved - ie. just the last bit, not the full path? I guess I could parse the string from the end and go backwards until I reached the first '\', but I wondered if there was a simpler way.

Secondly, when using the opendialog command, is it possible to set the initial directory that is opened? I know it works for the save dialog, for example:



works fine, but when I do it for the open dialog, eg.


it throws up an error saying the parameters don't match.

Thanks for any help.

Alquerian
19
Years of Service
User Offline
Joined: 29th Mar 2006
Location: Reno Nevada
Posted: 18th Sep 2006 04:05
Well, it would be nice to return the short file name, however I do not think there is a way to do it from bluegui. However, here is a snippet which will trim a full path+filename to just the filename:



It may require a little tweaking for your specific usage. I found it on the forum here somewhere, I modified it a bit so I cannot claim full credit for the work.

And this is what I use to open a file with it's specified path and it works fine for me:


Yours looks ok, you probably just need ,0, before the path. Hope this works

"We are what we repeatedly do. Excellence, therefore, is not an act, but a habit." - Aristotle
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 18th Sep 2006 12:35
Thanks for that Alquerian - I thought I would end up parsing the file string. Got that working now.

Thanks for solving the second problem for me too - you're right, I hadn't put the extra zero in for initial file options.

Cheers,

Ric.

Login to post a reply

Server time is: 2025-05-17 09:45:05
Your offset time is: 2025-05-17 09:45:05