Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4095
Number of posts: 14007

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Re: Dev-Pascal text file creating problem Posted by Manning on 21 Feb 2004 at 12:59 PM
: 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.
Thread Tree
ShadowK Dev-Pascal text file creating problem on 21 Feb 2004 at 12:45 AM
zibadian Re: Dev-Pascal text file creating problem on 21 Feb 2004 at 2:16 AM
bpajk Re: Dev-Pascal text file creating problem on 21 Feb 2004 at 7:56 AM
Manning Re: Dev-Pascal text file creating problem on 21 Feb 2004 at 8:40 AM
ShadowK Re: Dev-Pascal text file creating problem on 21 Feb 2004 at 12:08 PM
ShadowK Re: Dev-Pascal text file creating problem on 21 Feb 2004 at 12:17 PM
Manning Re: Dev-Pascal text file creating problem on 21 Feb 2004 at 12:59 PM
ShadowK Re: Dev-Pascal text file creating problem on 21 Feb 2004 at 11:54 AM
bpajk Re: Dev-Pascal text file creating problem on 21 Feb 2004 at 2:15 PM
ShadowK Re: Dev-Pascal text file creating problem on 21 Feb 2004 at 3:47 PM
bpajk Re: Dev-Pascal text file creating problem on 21 Feb 2004 at 4:45 PM



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.