ParamStr(0) buggy?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ParamStr(0) buggy?

Hans-Juergen Taenzer
Hello,

at the end of ParamStr(0) there is a wrong character.

A small testprogramm:

<---------------------------------------------------------->
Program t1;
var
i : longint ;
begin
    Writeln( 'paramstr(0): <' + paramstr(0) + '>');

    Writeln( 'Count other Parms: ', ParamCount);
    Writeln( 'Other Parms: ');

    For i :=1 to ParamCount do
        Writeln ( '<' + ParamStr(i) + '>');
end.

<---------------------------------------------------------->

The output of this programm is:

<---------------------------------------------------------->
C:\TMP\fp_test_paramstr>t1 2 3 4
paramstr(0): <C:\TMP\fp_test_paramstr\t1.exeL>
Count other Parms: 3
Other Parms:
<2>
<3>
<4>
<---------------------------------------------------------->

Compilerversion (source and targetplatform is win32):

Free Pascal Compiler version 2.0.0 [2005/05/08] for i386
Copyright (c) 1993-2005 by Florian Klaempfl

Hans-Jürgen

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: ParamStr(0) buggy?

Luiz Americo Pereira Camara-2
Hans-Juergen Taenzer wrote:

> Hello,
>
> at the end of ParamStr(0) there is a wrong character.
>
> A small testprogramm:
>
> <---------------------------------------------------------->
> Program t1;
> var
> i : longint ;
> begin
>     Writeln( 'paramstr(0): <' + paramstr(0) + '>');
>
>     Writeln( 'Count other Parms: ', ParamCount);
>     Writeln( 'Other Parms: ');
>
>     For i :=1 to ParamCount do
>         Writeln ( '<' + ParamStr(i) + '>');
> end.
>
> <---------------------------------------------------------->
>
> The output of this programm is:
>
> <---------------------------------------------------------->
> C:\TMP\fp_test_paramstr>t1 2 3 4
> paramstr(0): <C:\TMP\fp_test_paramstr\t1.exeL>
> Count other Parms: 3
> Other Parms:
> <2>
> <3>
> <4>
> <---------------------------------------------------------->
>

This is fixed in fpc 2.0.1 or 2.1.1

Luiz
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: ParamStr(0) buggy?

Hans-Juergen Taenzer
Luiz Américo wrote:
 > Hans-Juergen Taenzer wrote:

 >>
 >> at the end of ParamStr(0) there is a wrong character.
 >>

 > This is fixed in fpc 2.0.1 or 2.1.1

Sorry, but it isn't.

I downloaded the newest snapshot (compiler and rtl) with date 9.9.05.

The error still exists.


Thanks for your feedback.

Hans-Jürgen

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: ParamStr(0) buggy?

Marco van de Voort
> Luiz Am?rico wrote:
>  > Hans-Juergen Taenzer wrote:
>
>  >>
>  >> at the end of ParamStr(0) there is a wrong character.
>  >>
>
>  > This is fixed in fpc 2.0.1 or 2.1.1
>
> Sorry, but it isn't.
>
> I downloaded the newest snapshot (compiler and rtl) with date 9.9.05.
>
> The error still exists.

Not in 2.1.1 of yesterday. Not tested.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: ParamStr(0) buggy?

Florian Klämpfl
In reply to this post by Hans-Juergen Taenzer
Hans-Juergen Taenzer wrote:

> Luiz Américo wrote:
>  > Hans-Juergen Taenzer wrote:
>
>  >>
>  >> at the end of ParamStr(0) there is a wrong character.
>  >>
>
>  > This is fixed in fpc 2.0.1 or 2.1.1
>
> Sorry, but it isn't.
>
> I downloaded the newest snapshot (compiler and rtl) with date 9.9.05.
>
> The error still exists.
c:\fpc>c:\fpc\compiler\ppc386 -n -Fuc:\fpc\rtl\units\i386-win32 test.pas -l
Free Pascal Compiler version 2.1.1 [2005/09/09] for i386
Copyright (c) 1993-2005 by Florian Klaempfl

c:\fpc>test 1 2 3 4
paramstr(0): <c:\fpc\test.exe>
Count other Parms: 4
Other Parms:
<1>
<2>
<3>
<4>
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: ParamStr(0) buggy?

Hans-Juergen Taenzer
Florian Klaempfl wrote:
 > Hans-Juergen Taenzer wrote:

 >> Sorry, but it isn't.
 >>
 >> I downloaded the newest snapshot (compiler and rtl) with date
 >> 9.9.05.
 >>
 >> The error still exists.
 > c:\fpc>c:\fpc\compiler\ppc386 -n -Fuc:\fpc\rtl\units\i386-win32
 > test.pas -l Free Pascal Compiler version 2.1.1 [2005/09/09] for
 > i386 Copyright (c) 1993-2005 by Florian Klaempfl

 > c:\fpc>test 1 2 3 4
 > paramstr(0): <c:\fpc\test.exe>


Thanks.
Version 2.1.1 did it.

BTW: in

ftp://ftp.freepascal.org/pub/fpc/snapshot/v21/i386-win32/base.i386-
win32.zip

is Version 2.0.1.  Is this correct?

Gruss
     Hans-Jürgen

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal