Page 1 of 1

Requester asking to choose a directory

Posted: Wed May 17, 2017 2:53 am
by Pierre55
Hi,

I'm looking the way to have a requester that will allow me to choose a new current directory wich is currently the directory of my script.

Thanks

Re: Requester asking to choose a directory

Posted: Wed May 17, 2017 7:26 am
by jPV

Re: Requester asking to choose a directory

Posted: Wed May 17, 2017 7:55 am
by Allanon
...and to change current disrectory:

ChangeDirectory

:)

Re: Requester asking to choose a directory

Posted: Wed May 17, 2017 1:58 pm
by Pierre55
I search true the AmigaGuide but since there is no search function (it's shadowed) it's hard to find something... :-)

Thank you...

Re: Requester asking to choose a directory

Posted: Wed May 17, 2017 3:48 pm
by Allanon
You are welcome!
:D

Re: Requester asking to choose a directory

Posted: Wed May 17, 2017 11:34 pm
by Pierre55
Hi,

The ChangeDirectory create a problem wih the script, the .XML files are not found anymore!

Maybe I have to save the current directory before changing it, then restore after?

I found way to make it work without changing the current directory, I'm not sure it will be compatible with Mac!

Case "mn_include_all":
P$ = PathRequest("Indiquer l'endroit des fichiers EXP???.CSV")
V = 0
For Local V = 1 To 999
E = Exists(P$ .. "/" .. "Exp" .. StrStr(V) .. ".csv")
While E = 1
f$ = P$ .. "/" .. "Exp" .. StrStr(V) .. ".csv"
projectname$ = f$
OpenFile(1, projectname$)

Bye!

Re: Requester asking to choose a directory

Posted: Mon May 22, 2017 10:03 am
by jPV
You should do at least this change to make it safer.

replace this:

Code: Select all

P$ .. "/" .. "Exp" .. StrStr(V) .. ".csv"
with this:

Code: Select all

FullPath(P$, "Exp" .. StrStr(V) .. ".csv")
Then you don't have to worry how it works in different systems and what user selects as a path.

There are also some directory handling functions in DOS library, which you might find handy. ReadDirectory and DirectoryItems, for example.