Requester asking to choose a directory

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

Requester asking to choose a directory

Post by Pierre55 » Wed May 17, 2017 2:53 am

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: 129
Joined: Sat Mar 26, 2016 11:44 am
Location: RNO
Contact:

Re: Requester asking to choose a directory

Post by jPV » Wed May 17, 2017 7:26 am


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

Re: Requester asking to choose a directory

Post by Allanon » Wed May 17, 2017 7:55 am

...and to change current disrectory:

ChangeDirectory

:)
----------------------------
[Allanon] Fabio Falcucci
AMC - Creative Development // Docs Site // Support Forum
Support me on Patreon for Hollywood libraries!

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

Re: Requester asking to choose a directory

Post by Pierre55 » Wed May 17, 2017 1:58 pm

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: 435
Joined: Sun Feb 14, 2010 8:53 pm
Location: Italy
Contact:

Re: Requester asking to choose a directory

Post by Allanon » Wed May 17, 2017 3:48 pm

You are welcome!
:D
----------------------------
[Allanon] Fabio Falcucci
AMC - Creative Development // Docs Site // Support Forum
Support me on Patreon for Hollywood libraries!

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

Re: Requester asking to choose a directory

Post by Pierre55 » Wed May 17, 2017 11:34 pm

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: 129
Joined: Sat Mar 26, 2016 11:44 am
Location: RNO
Contact:

Re: Requester asking to choose a directory

Post by jPV » Mon May 22, 2017 10:03 am

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