Requester asking to choose a directory

Find quick help here to get you started with Hollywood

Requester asking to choose a directory

Postby 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
Pierre55
 
Posts: 16
Joined: Sat Apr 01, 2017 4:25 pm

Re: Requester asking to choose a directory

Postby jPV » Wed May 17, 2017 7:26 am

User avatar
jPV
 
Posts: 48
Joined: Sat Mar 26, 2016 11:44 am
Location: RNO

Re: Requester asking to choose a directory

Postby Allanon » Wed May 17, 2017 7:55 am

...and to change current disrectory:

ChangeDirectory

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

Re: Requester asking to choose a directory

Postby 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...
Pierre55
 
Posts: 16
Joined: Sat Apr 01, 2017 4:25 pm

Re: Requester asking to choose a directory

Postby Allanon » Wed May 17, 2017 3:48 pm

You are welcome!
:D
User avatar
Allanon
 
Posts: 345
Joined: Sun Feb 14, 2010 8:53 pm
Location: Italy

Re: Requester asking to choose a directory

Postby 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!
Pierre55
 
Posts: 16
Joined: Sat Apr 01, 2017 4:25 pm

Re: Requester asking to choose a directory

Postby 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.
User avatar
jPV
 
Posts: 48
Joined: Sat Mar 26, 2016 11:44 am
Location: RNO


Return to Newbie questions

Who is online

Users browsing this forum: No registered users and 1 guest