J jxhdy2001 Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-02 #1 十六进制大小为: 字 例如: -5 转换成十六进制为 FFFB FFFB又能转换成-5 请教上面的如何实现?
B bjaman Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-02 #2 http://www.delphibbs.com/keylife/iblog_show.asp?xid=3931, 不知可否提供一点参考?
L lhc4000 Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-02 #3 procedure TForm1.Button1Click(Sender: TObject); begin edit1.text:=inttohex(-5,2) //得FFFFFFFB end; procedure TForm1.Button2Click(Sender: TObject); begin edit2.text:=inttostr(strtoint('$'+edit1.text));//得-5 end;
procedure TForm1.Button1Click(Sender: TObject); begin edit1.text:=inttohex(-5,2) //得FFFFFFFB end; procedure TForm1.Button2Click(Sender: TObject); begin edit2.text:=inttostr(strtoint('$'+edit1.text));//得-5 end;
J jxhdy2001 Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-02 #4 谢谢 两位: 可我想要的是:-5 转换后等于FFFB FFFB转换后 为 -5 正在学习Bjaman的函数。。。。。
W wjh_wy Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-02 #5 procedure TForm1.Button1Click(Sender: TObject); begin Label1.Caption := IntToHex(Word(StrToInt(Edit1.Text)), 4); end; procedure TForm1.Button2Click(Sender: TObject); begin Label1.Caption := IntToStr(SmallInt(StrToInt('$'+Edit1.Text))); end;
procedure TForm1.Button1Click(Sender: TObject); begin Label1.Caption := IntToHex(Word(StrToInt(Edit1.Text)), 4); end; procedure TForm1.Button2Click(Sender: TObject); begin Label1.Caption := IntToStr(SmallInt(StrToInt('$'+Edit1.Text))); end;