请问Delphi中判断数字的函数是哪个?也就是区分字母和数字的哪个函数!请问他是包含在哪个单元里的?
还有就是我经常见别人用TDataTimePicker控件,为什么找不到,是不是自创的控件,请教!
还有就是我经常见别人用TDataTimePicker控件,为什么找不到,是不是自创的控件,请教!
解决方案 »
- 给Delphi2006的代码收缩功能增加一个系统热键
- 有关安装FastReport的问题
- 关于DLL中Begin……end的问题
- ◆◆◆◆◆在Delphi程序中,如何监视某一个程序的运行状态?若正在运行或已经运行,程序就做出提示
- 大家有用Delphi编写过消息队列、文件池、消息池方面的经验吗?介绍一下吧。。。
- 想做一个MDI结构的窗体,类似于金碟2000XP软件窗体,在建立后,为什么mdiform调用mdichild后mdichild总是关不了是怎么回事呢?(散分了)
- 关于Delphi调用C的接口问题
- 如何通过程序设定本机ip地址。
- 为什么生成执行文件后,运行时程序退不出来?
- windows的文件名命名规则是什么?
- 菜的问题,我的DELPHI怎么用ExpressQuantumGrid 4?我安装后怎么做?
- 咨询:关于注册软件公司
str: string;
lp: integer;
begin
str := '12kdk';
for lp := 1 to length(str) do
if str[lp] in ['0'..'9'] then
showmessage('数字')
else
showmessage('非数字')
end;
(ord(c) >=ord('0'))and (ord(c)<=ord('9'))TDataTimePicker控件在win32页
if Code <> 0 then 不是数字。
var i:integer;xsd:integer;
begin
result:=true;
xsd:=0;
for I := 1 to Length(S) do
begin
case s[i] of
['0'..'9']:;
['.']:inc(xsd);
else
begin
result:=false;
break;
end;
end;
result:=result and (xsd<=1);
end;
function IsInt(const s:string):boolean;
var i:integer;
begin
result:=true;
for I := 1 to Length(S) do
begin
case s[i] of
['0'..'9']:;
else
begin
result:=false;
break;
end;
end;
end;
function IsNumeric(tmp_str: string): Boolean;
var
i: double;
begin
Result := True;
try
i := StrToFloat(Tmp_Str);
except
Result := False;
end;
end;
//嘻嘻!简单吧
{
return;
} else{
Key='\b';
ShowMessage("请输入数字");
}
以上是c做的,变成pascal的这样:
if (key>='0') and (key<='9') then ...
就可以了
'.' 代表小数点,
'\b'代表空格
strtoint(...)
except
showmessage(...)
end;
就可以