Mega Code Archive

 
Categories / Delphi / Algorithm Math
 

Convert an octal number to integer

Title: 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;