// Hexadecimal (s) --> decimal (I) [rewrite: jey]
Function hextoint (S: string): integer;
Begin // $ indicates hexadecimal
Result: = strtoint ('$' + S );
End;
// Convert decimal to binary string [rewrite: jey]
Function inttobin (I: integer): string;
Begin
While I <> 0 do
Begin // I mod 2 modulo and format it with format
Result: = format ('% d' + result, [I mod 2]);
I: = I Div 2
End
End;
// Binary (s) --> decimal (d) [rewrite: jey]
Uses math;
Function hextoint (S: string): Double;
Begin
While length (s) <> 0 do
Begin // 2 ^ (length-1) Power
If s [1] = '1' then result: = Result + power (2, length (S)-1 );
S: = copy (S, 2, length (s ));
End
End;
// Decimal (I) --> hexadecimal (s)
// D built-in function, digits length, generally set to 4.
Function inttohex (value: integer; digits: integer): string;
// Data (s) --> binary (s)
// Any data is stored in binary format! (Transfer)
Function conertde (S: string): string;
VaR
I: integer;
Begin
For I: = 1 to length (s) do
Result: = result + inttohex (ord (s [I]), 2 );
End;