Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
How do I return the directory in which my program resides / has been launched?
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
How many lines is too man...
by
Martin_fr
[
Today
at 08:20:20 pm]
TDirectoryEdit with OnAft...
by
dsiders
[
Today
at 08:19:12 pm]
Debian removes FPC/Lazaru...
by
Fred vS
[
Today
at 08:07:30 pm]
Set horizontal scroll pos...
by
Hartmut
[
Today
at 07:21:20 pm]
[SOLVED] Add Help to an A...
by
valdir.marcos
[
Today
at 07:18:00 pm]
Benchmark test in nanosec...
by
marcov
[
Today
at 06:56:26 pm]
Variable initialization
by
valdir.marcos
[
Today
at 05:58:47 pm]
Lazarus IDE built for LCL...
by
valdir.marcos
[
Today
at 05:57:09 pm]
X11Libre, finally and for...
by
valdir.marcos
[
Today
at 05:45:57 pm]
Front-end framework
by
valdir.marcos
[
Today
at 04:10:22 pm]
Status of LCL-fpGUI widge...
by
valdir.marcos
[
Today
at 04:04:53 pm]
Status of LCL's CustomDra...
by
zeljko
[
Today
at 03:59:56 pm]
Problem wih reference to ...
by
henrique
[
Today
at 02:39:50 pm]
uses unit decalration ord...
by
Martin_fr
[
Today
at 02:10:32 pm]
Update a table with an Au...
by
CraigC
[
Today
at 01:56:50 pm]
could Ardour's YTK be use...
by
robert rozee
[
Today
at 01:51:39 pm]
[SOLVED] File Format LAMW...
by
RaketeMike
[
Today
at 01:41:46 pm]
[ANN] PasBuild 1.5.0 rele...
by
cdbc
[
Today
at 05:10:09 am]
Commerce website written ...
by
valdir.marcos
[
Today
at 04:55:08 am]
New book on Object Pascal
by
valdir.marcos
[
Today
at 04:30:08 am]
How to execute a procedur...
by
Aruna
[
Today
at 03:34:41 am]
BGRAVirtualScreen - weird...
by
backprop
[
Today
at 03:33:51 am]
The "dockedformeditor" pa...
by
Gustavo 'Gus' Carreno
[
Today
at 02:44:31 am]
unit ProjectDescriptorTyp...
by
n7800
[
Today
at 02:01:39 am]
Canvas.StretchDraw, does ...
by
jamie
[March 06, 2026, 11:27:18 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: How do I return the directory in which my program resides / has been launched? (Read 4584 times)
xircon
New Member
Posts: 25
How do I return the directory in which my program resides / has been launched?
«
on:
May 09, 2010, 06:29:39 am »
Have tried GetDir & GetCurrentDir, both work in the IDE, but do not outside, when launched from cairo-dock.
Been reading the RTL pages for hours and can't spot it, too early! More coffee is requred.
Cheers
Steve
Logged
Kunstbanause
New Member
Posts: 47
Re: How do I return the directory in which my program resides / has been launched?
«
Reply #1 on:
May 09, 2010, 06:47:43 am »
Under Windows, just do:
Code:
[Select]
mypath := ExtractFilePath(ParamStr(0)); // mypath is String
Logged
xircon
New Member
Posts: 25
Re: How do I return the directory in which my program resides / has been launched?
«
Reply #2 on:
May 09, 2010, 07:05:57 am »
Works on Linux as well
Thank you, just couldn't spot it!
Steve
Logged
Marc
Administrator
Hero Member
Posts: 2673
Re: How do I return the directory in which my program resides / has been launched?
«
Reply #3 on:
May 13, 2010, 03:44:39 pm »
Note that there are cases in linux where it doesn't give you the path (cant remember which)
Logged
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the
bug tracker
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
How do I return the directory in which my program resides / has been launched?
TinyPortal
© 2005-2018