Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2011-09

Mistake in ApplicationName() documentation

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Below is a quote from the documentation of the ApplicationName() function:

"Standard this is equal to the result of ParamStr(0), but it can be customized by setting the OnGetApplicationName callback."

This seems incorrect, as the following test program shows.

------------------[ test1.pas ]--------------------------
program test1;
{$mode objfpc}{$H+}
uses
  Classes, Sysutils;
begin
  writeln('ParamStr(0):      <' + ParamStr(0) + '>');
  writeln('ApplicationName:  <' + ApplicationName + '>');
end.
---------------------------------------------------------

Here is the console output of above program:

  $ mv test1 test1.elf64
  $ ./test1.elf64
  ParamStr(0):      </tmp/test1>
  ApplicationName:  <test1>

ApplicationName() only returns the filename portion (without paths or extensions) of ParamStr(0).

Am I miss interpreting the documentation, are is this an actual mistake in the docs. If the latter, then I'll create a documentation patch for ApplicationName().

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Unknown author
to Graeme Geldenhuys
Graeme Geldenhuys wrote 7 lines
Hi, Below is a quote from the documentation of the ApplicationName() function: "Standard this is equal to the result of ParamStr(0), but it can be customized by setting the OnGetApplicationName callback."

It should say 'filename part' of paramstr(0)

I have adapted the docs.

Michael.

Reply by email

Unknown author
to Unknown author
Show quoted text 15 lines
On Tue, 13 Sep 2011, Graeme Geldenhuys wrote: > Hi, > > Below is a quote from the documentation of the ApplicationName() function: > > "Standard this is equal to the result of ParamStr(0), but it can be > customized by setting the OnGetApplicationName callback." > It should say 'filename part' of paramstr(0) I have adapted the docs.

By the way, the second paragraph in the help already contained this info. But I've been more explicit.

Michael.

Reply by email

Graeme Geldenhuys
to Unknown author
michael.vancan... wrote
> > I have adapted the docs.

Thanks.

By the way, the second paragraph in the help already contained this info.

Yes I saw that, but the original two paragraphs seem to contradict themselves. So a clarification seemed in order. ;-)

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Vincent Snijders
to Unknown author: By the way, the second paragraph in the help already contained this info. But I've been…

2011/9/13, :

Show quoted text 29 lines
On Tue, 13 Sep 2011, wrote: > > > On Tue, 13 Sep 2011, Graeme Geldenhuys wrote: > >> Hi, >> >> Below is a quote from the documentation of the ApplicationName() >> function: >> >> "Standard this is equal to the result of ParamStr(0), but it can be >> customized by setting the OnGetApplicationName callback." >> > > It should say 'filename part' of paramstr(0) > > I have adapted the docs. By the way, the second paragraph in the help already contained this info. But I've been more explicit. Michael. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email