
/**//*
**判断。
**参数:
** as_string ----客户输入字符串
**返回:
** -1==>该字符串不合法
** 1 ==>字符串合法
**作者:
** 毕中亮
** 2007.05.25
*/
long ll_len,ll_lenw,ll_place,ll_placew
long i,j
ll_len = len(as_string)
ll_lenw = lenw(as_string)
ll_place = Pos(as_string, ' ')
if ll_place > 0 THEN
messagebox('提示:','字符串中含有空格,位置 '+ string(ll_place))
return -1
END IF
ll_placew = PosW(as_string,' ')
if ll_placew > 0 then
messagebox('提示:','字符串中含有空格,位置 '+ string(ll_placew))
return -1
end if
if ll_len = ll_lenw then
return 1
else
messagebox('提示:','字符串中含有在全角状态下输入的字符!')
return -1
end if
本文介绍了一个简单的字符串合法性检查程序,该程序能够判断用户输入的字符串是否包含空格或全角字符,并据此给出相应的反馈。
807

被折叠的 条评论
为什么被折叠?



