向 向你学习 Unregistered / Unconfirmed GUEST, unregistred user! 2001-11-13 #1 怎么判断EDIT里输入是数字?还有money ,real类型怎么和str转换,谢谢
M mjy97 Unregistered / Unconfirmed GUEST, unregistred user! 2001-11-13 #2 1、在EDIT的KeyPress事件中判断 procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char); begin if not(Key in ['1','2','3','4','5','6','7','8','9','0','.']) then Abort; end; 2、floattostr()和strtofloat()
1、在EDIT的KeyPress事件中判断 procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char); begin if not(Key in ['1','2','3','4','5','6','7','8','9','0','.']) then Abort; end; 2、floattostr()和strtofloat()
K kaideng Unregistered / Unconfirmed GUEST, unregistred user! 2001-11-13 #3 function IsNumeric(c: char): Boolean;
A antic_ant Unregistered / Unconfirmed GUEST, unregistred user! 2001-11-13 #4 用inttostr()来判断 function IsNumeric(c: string): Boolean; var i:integer; begin result:=false; try i:=strtoint(edit.text); result:=true; except result:=false; end; end; 第二个问题 sfje_str:=formatfloat('0.00',sfje); sfje_str为string类型 sfje为real
用inttostr()来判断 function IsNumeric(c: string): Boolean; var i:integer; begin result:=false; try i:=strtoint(edit.text); result:=true; except result:=false; end; end; 第二个问题 sfje_str:=formatfloat('0.00',sfje); sfje_str为string类型 sfje为real
K kaideng Unregistered / Unconfirmed GUEST, unregistred user! 2001-11-13 #5 楼上怎么瞎说? IsNumeric是delphi自己的函数,还用你瞎写?
S SuperJS Unregistered / Unconfirmed GUEST, unregistred user! 2001-11-13 #7 to kaideng: delphi确实有IsNumeric,但是他的参数是char啊!老兄!