Is there a GetCurrentDirectory command?

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by julianbury.

I need to provide a filepath including my current directory.
I cannot find how to get the path to my current directory.

I couldn't see it in the helpfile.
I couldn't find it in the online docs :-/

It's probably obvious and I'll be ashamed but ... HELP!

:-(

Julian ^00^
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Sebi.

You can use GetCurrentDirectory_().

Code: Select all

Path.s=Space(255)GetCurrentDirectory_(255,@Path)

Debug Path
PureFan
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Pupil.

julianbury, try to use the search feature of this forum also, there's lots of good stuff hiding there..
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by julianbury.

Hi Sebi :)

Thanks for the tip.

Here is what I have done with it ...

Code: Select all

Global appdir$  ;application directory
path.s=Space(255)
GetCurrentDirectory_(255,@path)
appdir$=path

Procedure get_Help()
  R=RunProgram(appdir$+"\Help.htm")
EndProcedure

Procedure Open_CalcDir()
  R=RunProgram(appdir$+"\data\Calculations")
EndProcedure
So, I can now evoke the HTML file and open directory windows.

I intend that the user shall be able to load and save
the calculations. The existing files need to be visible
so that the user may select which to load or which
filenames are already in use, as he decides what
filename to "Save As".

When I open files and directories from the application,
control does not return to my application until the user
returns it or the files and directories are closed.

Do you know of any way for my app to regain control
immediately, not waiting for the user?

I want my application to be able to close directory
windows and the help file. Is this possible?

I am considering making a temporary window showing the file list.
Since I cannot anticipate how long the list might be,
I would prefer just using directory windows.

What is your opinion?
Can I close the window and Help file?


Julian ^00^
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> I couldn't see it in the helpfile.
> I couldn't find it in the online docs :-/
> It's probably obvious and I'll be ashamed but ... HELP!

It's in the Beginner's FAQ for these very forums:

viewtopic.php?t=4876

Be ashamed. :)
Post Reply