Люди найдите ошибку!
(Ошибка в функции Function RealFromString(Val:String):Real
у меня из-за нее мидлет не работает
Function Repl(Str:String;Chr1,Chr2:Char):String;
var i:integer;
Begin
For i:=0 to Length(Str)-1 do
If GetChar(str,i)=Chr1 then Str:=SetChar(str,Chr2,i)
Repl:=Str;
End;
Function XStepPY(X,Y:Integer):Integer;
var i,s:integer;
Begin
s:=1;
If Y>0 then
for i:=1 to Y do s:=s*x
else
If Y=0 then s:=1
else s:=-1;
XStepPY:=s;
End;
Function RSgn(Val:Real):Real;
Begin
RSgn:=Val/RAbs(Val);
End;
Function RealFromString(Val:String):Real;
Var A,P,i:Integer;
B:real;
S:string;
Begin
B:=0;
A:=StringToInteger(Val);
S:=Repl(Val,',','.');
P:=Pos(S,'.');
S:=Copy(S,P+1,Length(S)-1);
if P=-1 then
RealFromString:=A
else
begin
for i:=0 to Length(S)-1 do
B:=B+StringToInteger(GetChar(S,i))/XStepPY(10,i+1);
B:=B*RSgn(A);
RealFromString:=A+B;
end;
end;