unit pasvers; interface Type TCmplx=record Re,Im:Real; end; procedure StrToCmplx(Num:string;var Cmplx:TCmplx); implementation procedure StrToCmplx(Num:string;var Cmplx:TCmplx); var i,symb1,symb2:Integer; begin symb1:=0; symb2:=0; for i:=2 to length(Num) do begin if (Copy(Num,i,1)='+') or (Copy(Num,i,1)='-') then symb1:=i; if Copy(Num,i,1)='j' then symb2:=i; end; if (symb1=0) and (symb2=0) then begin symb1:= length(num) +1; Val(Copy(num ,1,(symb1-1)),Cmplx.Re,i); end; if symb1<>0 then Val(copy(num,1,(symb1-1)),Cmplx.Re,i); if symb2<>0 then begin if symb1=0 then symb1:=1; Val(Copy(num,symb1,(symb2-symb1)),Cmplx.Im,i); end; end; end.