try
strtoint(mystr)
showmessage('此乃数字也!')
except
if mystr=uppercase(mystr) then
showmessage('此乃大写字母!')
else
if mystr=ulowercase(mystr) then
showmessage('此乃小写字母!')
else
showmessage('无法识别,可能是混杂型,:(')
end;
可以在Edit的KeyPress事件中加入如下代码:
if (Key in ['0'..'9']) then
showmessage('此乃数字也!');
if (Key in ['A'..'Z']) then
showmessage('此乃大写字母!');
if (Key in ['a'..'z']) then
showmessage('此乃小写字母!')
照此,你还可以判别其他字符;