大神,求指教弹出错误对话框
在编写表单时,如果出现非数学字符弹出对话框要求重新输入怎么写啊
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)+"位是字母" Otherwise ?a+"的第"+ Transform(i)+"位是数字字母外的字符" Endcase Endfor
clear do while .t. accept "请输入一个数字字符串:" to x if len(chrtran(x,"0123456789",""))>0 messagebox("字符串 "+x+" 中含有非数字字符,请重新输入") else ?"1/"+x if messagebox("继续输入吗",4,"提示信息")=6 loop else exit endif endif enddo