- 如何将“a”变量传递给 HostToNetwork() ?需要以某种方式转换它..
以及如何插入“a”变量,这个十六进制代码?
var a : array[0..19] of Shortint; h : string; h =: '714BD6D36D4944F4E4F943CB03D128EA5C372FF6'; GStack.HostToNetwork(a)
来自 IdStack.pas:
function HostToNetwork(AValue: Word): Word; overload; virtual; abstract;
function HostToNetwork(AValue: LongWord): LongWord; overload; virtual; abstract;
function HostToNetwork(AValue: Int64): Int64; overload; virtual; abstract;
function HostToNetwork(const AValue: TIdIPv6Address): TIdIPv6Address; overload; virtual;
谢谢
编辑:
h := '714BD6D36D4944F4E4F943CB03D128EA5C372FF6';
for x := 0 to 19 do
begin
a[x] := StrToInt('$'+Copy(h, x, 2));
end;
正确的 ?