Sign in Join

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

Mailing lists / fpc-pascal / 2005-09

ParamStr(0) buggy?

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

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

Luiz Américo
to Hans-Juergen Taenzer
Hans-Juergen Taenzer wrote 34 lines
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

Hans-Juergen Taenzer
to Luiz Américo
Luiz Américo wrote 7 lines
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

Marco van de Voort
to Hans-Juergen Taenzer
Show quoted text 14 lines
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.

Florian Klaempfl
to Hans-Juergen Taenzer: Sorry, but it isn't. I downloaded the newest snapshot (compiler and rtl) with date 9.9.05.
Hans-Juergen Taenzer wrote 14 lines
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>

Hans-Juergen Taenzer
to Florian Klaempfl
Florian Klaempfl wrote 14 lines
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