I iamfly Unregistered / Unconfirmed GUEST, unregistred user! 2001-01-09 #1 用inttohex可以把十进制的数字转成十六进制的,反过来呢?我记得以前好像用过,就是找 不到以前的那个例子,查了半天的HELP和资料,也没查到:( 那位兄台知道,请打救小弟,谢了:)
W wjiachun Unregistered / Unconfirmed GUEST, unregistred user! 2001-01-09 #2 1. function convert(s:string):integer begin len:=length(s); for i:=len downto 1 do begin r:=power(16,len-i)*value();//value把字符作相应的变换,如:'1'-1;'a'-10 end; end; 2.Edit2.Text:=Format('%d',[StrtoInt('$'+Edit1.Text)]);
1. function convert(s:string):integer begin len:=length(s); for i:=len downto 1 do begin r:=power(16,len-i)*value();//value把字符作相应的变换,如:'1'-1;'a'-10 end; end; 2.Edit2.Text:=Format('%d',[StrtoInt('$'+Edit1.Text)]);
J JohnsonGuo Unregistered / Unconfirmed GUEST, unregistred user! 2001-01-09 #3 10->16: IntToHex 16->10: StrToInt('$' + Str)