If I do following:
for n := 0 to paramcount - 1 do showmessage(paramstr(n));
Then I have NOT the last parameter on command line, if do:
for n := 1 to paramcount do ..
then I have all parameters. I use Delph5 pro. Seems a bug to me ?
not really a (code) bug, just poorly documented (which IS considered a bug
in some shops ;)
HTH
Justin
Wilfried Mestdagh <wilfrie...@csi.com> wrote in message
news:87c297$3o...@bornews.borland.com...
Why do you think so? Help for ParamStr() --
----------------
Index is an expression of type Integer. ParamStr returns the parameter from
the command line that corresponds to Index, or an empty string if Index is
greater than ParamCount. For example, an Index value of 2 returns the second
command-line parameter.
ParamStr(0) returns the path and file name of the executing program (for
example, C:\TEST\MYPROG.EXE).
----------------
You have n params, numbered from 1 to n, and paramStr(0) always returns the
full path to the current exe.
PhR
>Hello,
>
>If I do following:
>for n := 0 to paramcount - 1 do showmessage(paramstr(n));
>
>Then I have NOT the last parameter on command line, if do:
>for n := 1 to paramcount do ..
>
>then I have all parameters. I use Delph5 pro. Seems a bug to me ?
Nope, no bug. It is working exactly as designed and documented. From
the Delphi help --
"ParamStr returns the parameter from the command line that corresponds
to Index, or an empty string if Index is greater than ParamCount. For
example, an Index value of 2 returns the second command-line
parameter.
ParamStr(0) returns the path and file name of the executing program
(for example, C:\TEST\MYPROG.EXE)."
Nick Hodges - TeamB
Xapware Technologies -- http://www.xapware.com
thx, Wilfried
You're right. That example should be changed. I hope Janet sees this (I
changed the subject line). If not, she should be told by e-mail.
--
Rudy Velthuis
What's unclear to you about the ParamCount docs? Makes sense to me...
IMHO,
-Craig
--
Craig Stuntz cstuntz@no_spam.vertexsoftware.com
---------------- -----------------------------
Delphi Developer Vertex Systems Corporation
& Cat Wrangler http://www.vertexsoftware.com