//string to hexprocedure TForm1.Button1Click(Sender: TObject);var phex, pbin: Pchar; s: string;begin s := Edit1.Text; pbin := pchar(s); try GetMem(phex, 1000); FillMemory(phex, 1000, 0); BinToHex(pbin, phex, length(pbin)); Edit1.Text := StrPas(phex); finally FreeMem(phex); end;end;//Hex to strprocedure TForm1.Button2Click(Sender: TObject);var phex, pbin: Pchar; s: string;begin phex := pchar(Edit1.Text); try GetMem(pbin,1000); FillMemory(pbin,1000,0); HexToBin(phex,pbin,length(phex)); Edit1.Text := StrPas(pbin); finally FreeMem(pbin); end;end;