如何把Byte数组转换成整数?? 最后结果为 296591Procedure TForm1.Button4Click(Sender: TObject);
var
MyArray_byte : Array [0..3] Of Byte;Begin
MyArray_byte[0]:=143; //8F
MyArray_byte[1]:=134; //86
MyArray_byte[2]:=4; //4
MyArray_byte[3]:=0; //0 //如何把数组转换成整数 296591
End;
var
MyArray_byte : Array [0..3] Of Byte;Begin
MyArray_byte[0]:=143; //8F
MyArray_byte[1]:=134; //86
MyArray_byte[2]:=4; //4
MyArray_byte[3]:=0; //0 //如何把数组转换成整数 296591
End;
var
MyArray_byte : Array [0..3] Of Byte;
i:Integer;
Begin
MyArray_byte[0]:=143; //8F
MyArray_byte[1]:=134; //86
MyArray_byte[2]:=4; //4
MyArray_byte[3]:=0; //0
Move(MyArray_byte[0],i,SizeOf(Integer));
ShowMessage(IntToStr(i));
//如何把数组转换成整数 296591
End;
MyArray_byte : Array [0..3] Of Byte;
Value: Integer;
begin
MyArray_byte[0]:=143; //8F
MyArray_byte[1]:=134; //86
MyArray_byte[2]:=4; //4
MyArray_byte[3]:=0; //0
asm
mov edx, [MyArray_byte]
mov Value, edx
end;
ShowMessage(IntToStr(Value));
end;
tmpInt := MyArray_byte[3] shl 24 + MyArray_byte[2] shl 16 + MyArray_byte[1] shl 8 + MyArray_byte[0];