prior parameter's size depends on `Decinput'_(re)

Fri, 11 Jul 1997 10:35:40 +0000


This is a multi-part message in MIME format.

--------------6F2D1FAB6EBD
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Bill Currie wrote:
> 
> Peter Gerwinski wrote:
> >
> > According to Bill Currie:
> > >
> > > function DecToBin( DecInput : string ) : wrkstring;
> > > [...]
> > > trunkuti.pas: In function `Dectobin':
> > > trunkuti.pas:332: prior parameter's size depends on `Decinput'
> > > make.exe: *** [trunkuti.o] Error 1

> I'll keep trying to reproduce the error in a smaller file.

Right, Success!!
 I've managed to reproduce the error in a smaller file.  If I comment
out the parameters (or the body of the function) in the implementation
section, the error disapears.  In the real file, the ReadStr causes an
abort when the implementation paramteters are commented out (interface
decl same as always).

I have not yet been able to reproduce the abort.

The command line used is:

gpc -O2 -c -o foo.o foo.pas

Bill
-- 
Leave others their otherness.

--------------6F2D1FAB6EBD
Content-Type: text/plain; charset=us-ascii; name="foo.pas"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="foo.pas"

unit foo;
interface
uses
  System;
function DecToBin( DecInput : string ) : wrkstring;
implementation

function DecToBin( DecInput : string ) : wrkstring;

{ converts a decimal string[ up to 256 ] into binary string }

var
   TempStr : wrkstring;
   DecNum,
   Mask    : word;
   Pos     : byte;
   Err     : integer;

begin
  TempStr := '';
  mask    := $8000;
  ReadStr(DecInput,DecNum,Err);
  for Pos := 1 to 16 do begin
    if (mask and DecNum) > 0 then
      TempStr := TempStr + '1'
    else TempStr := TempStr + '0';
      mask := mask div 2;
  end;
  while (TempStr[1] = '0') and (length(TempStr) > 1) do  { returns at least 0}
    delete(TempStr,1,1);
  DecToBin := TempStr;
end;

end.

--------------6F2D1FAB6EBD--


Bill Currie (billc@blackmagic.tait.co.nz)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es