Requester asking to choose a directory

Find quick help here to get you started with Hollywood
Post Reply
Pierre55
Posts: 54
Joined: Sat Apr 01, 2017 4:25 pm

Requester asking to choose a directory

Post 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
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Requester asking to choose a directory

Post by jPV »

User avatar
Allanon
Posts: 732
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: Requester asking to choose a directory

Post by Allanon »

...and to change current disrectory:

ChangeDirectory

:)
Pierre55
Posts: 54
Joined: Sat Apr 01, 2017 4:25 pm

Re: Requester asking to choose a directory

Post 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...
User avatar
Allanon
Posts: 732
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: Requester asking to choose a directory

Post by Allanon »

You are welcome!
:D
Pierre55
Posts: 54
Joined: Sat Apr 01, 2017 4:25 pm

Re: Requester asking to choose a directory

Post 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!
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Requester asking to choose a directory

Post 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.
Post Reply