DELPHI没有,我记错了,这是别人写的
function octtobin(i:integer):string;
var
j:integer;
s:string;
begin
j:=i;
while j>2 do
begin
if (j mod 2)=1 then
s:='1'+s;
j:=j div 2;
end;
s:=inttostr(j) + s;
result:=s;
end;
function bintooct(k:string):integer;
var
i,j:integer;
s:string;
begin
for i:=0 to length(k)-1 do
begin
s:=copy(k,length(k)-i-1,1);
j:=j + (strtoint(s)*2^i);
end;
result:=j;
end;