Page 1 of 1

Application directory?

Posted: Sat Nov 06, 2004 6:28 am
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

Posted: Sat Nov 06, 2004 7:30 am
by Paul
change @pathname$ to @pathname
You already defined pathname.s in the first line.

$ <> .s

:)