Mega Code Archive

 
Categories / Delphi / Algorithm Math
 

How to convert an octal number to integer

Title: How to convert an octal number to integer function OctToInt(Value: string): Longint; var i: Integer; int: Integer; begin int := 0; for i := 1 to Length(Value) do begin int := int * 8 + StrToInt(Copy(Value, i, 1)); end; Result := int; end;