(* Collection of code snippets by Arne Vajhøj *)
(* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) *)
program radix;

{$APPTYPE CONSOLE}

uses
  SysUtils,Classes,WinSock;

function HexToInt(s : string) : integer;

var
   res : integer;

begin
   HexToBin(pchar(s), @res, 4);
   HexToInt := WinSock.ntohl(res);
end;

begin
  writeln(StrToInt('123'));
  writeln(IntToStr(123));
  writeln(IntToHex(123,8));
  writeln(HexToInt('0000007b'));
end.
