Application directory?

Just starting out? Need help? Post your questions and find answers here.
mearrin69
User
User
Posts: 10
Joined: Thu Jun 24, 2004 10:44 pm
Location: Vancouver, WA

Application directory?

Post by mearrin69 »

Hi all. Still new here :).

I want to retrieve the current directory (i.e. where the app is running from) for use in a file requester.

Checked the FAQ and tried the answer there but no luck. Here's the code I'm using:

Code: Select all

  ; Get current pathname
  pathname.s = Space(255)
  GetCurrentDirectory_(255, @pathname$)
  If Right(pathname, 1) <> "\"
    pathname + "\"
  EndIf
I get an error as follows:
AppName: purebasic589148620.exe AppVer: 0.0.0.0 ModName: ntdll.dll
ModVer: 5.1.2600.2180 Offset: 00013058

Any idea why? Am I missing something in my setup to call this function? Using 3.92 and I think everything is up to date. Any help appreciated.
THanks,
Michael
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1282
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Post by Paul »

change @pathname$ to @pathname
You already defined pathname.s in the first line.

$ <> .s

:)
Image Image
Post Reply