Registriert seit: 10. Jun 2002
Ort: Hamburg
72 Beiträge
Delphi XE7 Enterprise
|
AW: Float Zahlen in Hex Zahlen umwandeln
5. Dez 2013, 12:56
Probier mal folgendes:
Code:
...
type
TConvert32Bit = (Conv_AsFloat, Conv_AsInteger, Conv_AsByte, Conv_AsChar, Conv_AsSingle);
TConvertRecord = record
case TConvert32Bit of
Conv_AsFloat : (FloatValue : Double);
Conv_AsInteger : (IntValue : Integer);
Conv_AsByte : (ByteHH, ByteHL, ByteLH, ByteLL : Byte);
Conv_AsChar : (CharHH, CharHL, CharLH, CharLL : Char);
Conv_AsSingle : (HighSingle, LowSingle : Single);
end;
TForm1 = class(TForm)
...
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var ConvertVar : TConvertRecord;
FloatValue : Real;
begin
FloatValue := 0.0;
ConvertVar.FloatValue := FloatValue;
ShowMessage(IntToHex(ConvertVar.IntValue, 8));
FloatValue := 1234.1234;
ConvertVar.FloatValue := FloatValue;
ShowMessage(IntToHex(ConvertVar.IntValue, 8));
end;
Geändert von danielA ( 5. Dez 2013 um 12:59 Uhr)
|
|
Zitat
|