Generalnie rzecz biorąc chodzi tutaj o bytes […]
Nie bytes
, a digits
, bo to o liczbę znaków chodzi (0-F
), a nie bajtów.
Po prostu zastanawiałem się dlaczego Tokyo to potrafi robić bez zapisywania tej "8", a Berlin nie. Myślałem że może coś z "uses" mi się wykasowało.
Tak wyglądają deklaracje funkcji w Delphi Berlin:
function IntToHex(Value: Integer; Digits: Integer): string;
function IntToHex(Value: Int64; Digits: Integer): string;
function IntToHex(Value: UInt64; Digits: Integer): string;
A tak wyglądają w Delphi Tokyo:
function IntToHex(Value: Int8): string;
function IntToHex(Value: UInt8): string;
function IntToHex(Value: Int16): string;
function IntToHex(Value: UInt16): string;
function IntToHex(Value: Int32): string;
function IntToHex(Value: UInt32): string;
function IntToHex(Value: Int64): string;
function IntToHex(Value: UInt64): string;
function IntToHex(Value: Integer; Digits: Integer): string;
function IntToHex(Value: Int64; Digits: Integer): string;
function IntToHex(Value: UInt64; Digits: Integer): string;
Dodano funkcje przyjmujące wyłącznie jeden parametr, czyli liczbę do konwersji – liczba znaków na wyjściu dobierana jest automatycznie, według rozmiaru parametru Value
w bajtach.
Tak więc nie trać czasu na zastanawianie się – po prostu przeglądaj dokumentację.