Code:

function HexToBin(Hexadecimal: string): string;

const

BCD: array [0..15] ofstring =

('0000', '0001', '0010', '0011', '0100', '0101', '0110', '0111',

'1000', '1001', '1010', '1011', '1100', '1101', '1110', '1111');

var

i: integer;

begin

for i := Length(Hexadecimal) downto1do

Result := BCD[StrToInt('$' + Hexadecimal[i])] + Result;

end;

 

procedure TForm1.Button1Click(Sender: TObject);

begin

ShowMessage(HexToBin('FFA1'));

// Returns 1111111110100001

end;

 

Взято с сайта: https://www.swissdelphicenter

 

     
 

Code:

var

Str: Char;

begin

Str := 'В';

Form1.Caption := Format('%x', [Ord(Str)]);

end;

 

https://delphiworld.narod

DelphiWorld 6.0

 

Code:

procedure TForm1.Button1Click(Sender: TObject);

const Source: string = '4D 5A';

var S: string;

t: Integer;

begin

with TStringList.Create do

try

Text := StringReplace(Source, #32, #13#10, [rfReplaceAll]);

S := '';

for t := 0to Count - 1do

S := S + Chr(StrToInt('$' + Strings[t]));

ShowMessage(S);

finally

Free;

end;

end;

 

 

 

 

Автор:Song

Взято из https://forum.sources

 

 

     
 

Code:

var

i : integer

s : string;

begin

s := '$'+'20FF';

i := StrToInt(a);

end;

©Drkb::00937

Взято из https://forum.sources.ru

 

 


 

Code:

CONST HEX : ARRAY['A'..'F'] OF INTEGER = (10,11,12,13,14,15);

VAR

str : String;

Int,

i : integer;

BEGIN

READLN(str);

Int := 0;

FOR i := 1TO Length(str) DO

IF str[i] < 'A'THEN

Int := Int * 16 + ORD(str[i]) - 48

ELSE

Int := Int * 16 + HEX[str[i]];

WRITELN(Int);

READLN;

END.

 

 

https://delphiworld.narod

DelphiWorld 6.0

Code:

const

HKEYNames: array[0..6] ofstring =

('HKEY_CLASSES_ROOT',

'HKEY_CURRENT_USER',

'HKEY_LOCAL_MACHINE',

'HKEY_USERS',

'HKEY_PERFORMANCE_DATA',

'HKEY_CURRENT_CONFIG',

'HKEY_DYN_DATA');

 

function HKEYToStr(const Key: HKEY): string;

begin

if (key < HKEY_CLASSES_ROOT) or (key > HKEY_CLASSES_ROOT+6) then

Result := ''

else

Result := HKEYNames[key - HKEY_CLASSES_ROOT];

end;

 

 

 

 

 

Взято с сайтаhttps://www.swissdelphicenter.ch/en/tipsindex