有关字符判断代码
共享一个字符判断代码,有时可能会用到!*取整数
*Ceil(Month(date())/3)
clear
accept "请输入字符:" to a
do case
case ISLOWER(a)
?"该字符是小写字母。"
case ISUPPER(a)
?"该字符是大写字母。"
case ISDIGIT(a)
?"该字符是数字。"
OTHERWISE
?"该字符是其他特殊符号。"
endcase
clear
accept "请输入字符:" to a
if asc(a)>=48 and asc(a)<=57
?"该字符是数字。"
else
if asc(a)>=97 and asc(a)<=122
?"该字符是小写字母。"
else
if asc(a)>=65 and asc(a)<=90
?"该字符是大写字母。"
else
?"该字符是其他特殊符号。"
endif
endif
endif
CLEAR
LOCAL a as String
Accept "请输入一个字符串" To a
For i = 1 To Len(a)
b=Substr(a,i,1)
Do Case
Case Isdigit(b)=.T.
?a+"的第"+ Transform(i)+"位是数字"
Case Isalpha(b)=.T.
?a+"的第"+ Transform(i)+"位是字母"
Case ISLOWER(b)=.T.
?a+"的第"+ Transform(i)+"位是小写字母"
Case ISUPPER(b)=.T.
?a+"的第"+ Transform(i)+"位是大写字母"
Otherwise
?a+"的第"+ Transform(i)+"位是数字字母外的字符"
Endcase
Endfor