problem with gpclib.a (alpha-version)...

30 Apr 97 19:20:00 +0100


         A.Eckleder@chateau.cl.sub.de / oh no,some e-mail ... by ME!!!
 To:     GPC@HUT.FI (Gpc)
----------------------------------------------------------------------

...i've got some problem with the library file of the actual (?!?)  
alphaversion of gnu-pascal...
obviousely there's some problem in string-management (gpc2.0 libs do well)
here's some sample code:

type normstr=string[255];  {also tested with different string lengths}

function strng(z:real):normStr; {convert number to string}
var s:normstr;
    k:byte;
    neg:boolean;
begin
k:=0;
while (z<>int(z)) and (k<5) do
begin
 z:=z*10;
 inc (k);
end;
s:='';if z<0 then neg:=true else neg:=false;
z:=int(abs(z));
if z=0 then s:='0';
while z>0 do
begin
 s:=chr(trunc(z-int(z/10)*10)+48)+s;
 z:=int(z/10);
end;
if  k>0 then s:=copy(s,1,length(s)-k)+'.'+copy(s,length(s)-k+1,k);
if  neg then s:='-'+s;
strng:=s;
end;

as far as i could analyse the problem,the error occurs within the  
s:=chr(trunc(z-int(z/10)*10)+48)+s; expression.
i know that this is not very optimized code,but it normally works fine  
though.

the other problem i realized with this alpha-version is that i couldn't  
manage to use the inline assembler.
i only only got a message telling me function asm() not beeing existent.

because of this strong behavior i use the gpc2.0 compiler with the alpha- 
libraries...perhaps THIS is the reason why the function above doesn't  
work,
but i am not quite sure about that...

andy


/------------------- A.ECKLEDER@CHATEAU.CL.SUB.DE --------------------\
     Who is 'General Failure' - And why is he reading my harddisk ?
\------------------ Andreas Eckleder@2:2480/816.32 -------------------/
## CrossPoint v3.1 ##


Andreas Eckleder (A.ECKLEDER@CHATEAU.cl.sub.de (Andreas Eckleder))

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