:
This message was edited by ShadowK at 2004-2-21 12:19:13
: : In FPC there is a better function (the one zibadian suggested). Instead of:
: :
: :
: : path:=paramstr(0);
: : FSplit(path, dirstr, name, ext);
: :
: :
: : You can use:
: :
: :
: : DirStr := ExtractFilePath(ParamStr(0));
: :
: :
: : And just a note to the original message. Your statement of "The problem is that BP creates the text files next to the exe when no path is specified, Dev-Pas creates it in their own folder." is only partially correct. In both cases the text file is created in the current working directory. So if you were to run your FPC created program manually, not through the IDE, it should work the same as the BP program. But it's definitely a better solution to use ExtractFilePath(ParamStr(0)) so you can always guarantee you're looking in the right place for files.
: :
:
: I guess there isn't another way!
:
: DirStr := ExtractFilePath(ParamStr(0));
:
: Result: Error: Identifier not found EXTRACTFILEPATH
:
: I'll stick to bpajk's way. Thank you all for helping!
It's in the SysUtils unit so you have to include that. But whatever works for you.