如何让字符型的列只允许输入大写、小写或数字?

山野村夫 2006-09-11 09:24:30
如题
...全文
275 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
仰天长啸qsx 2006-09-11
  • 打赏
  • 举报
回复
赞同rightyeah(众妙之门)
Davy_Jones 2006-09-11
  • 打赏
  • 举报
回复
rightyeah(众妙之门) ( ) 信誉
说的方法很好
山野村夫 2006-09-11
  • 打赏
  • 举报
回复
DW的字段,选EditMask
填“!”表示一个大写字符,“!!!”三个大写字符
xiaoplx 2006-09-11
  • 打赏
  • 举报
回复
DW的字段,style type选edit, case属性 大字选择upper(1), 小写择lower(2)
数字style type选editmask,mask里输入#,#代表一个数字
rightyeah 2006-09-11
  • 打赏
  • 举报
回复
在column的validate属性里面写代码
Match(gettext(), "^[0-9a-zA-Z]*$")
dawugui 2006-09-11
  • 打赏
  • 举报
回复
只能是输入后自己判断是否合标准了.
山野村夫 2006-09-11
  • 打赏
  • 举报
回复
唉,怎么又是自己解决了
仰天长啸qsx 2006-09-11
  • 打赏
  • 举报
回复
这是校验MAC值的算法,可以参考

//开始检测输入的MAC值是否合法
li_pos1=1
li_pos2=pos(ls_mac,':')
lb_macflag=true

for li_loops=1 to 6
ls_temp=mid(ls_mac,li_pos1,li_pos2 -li_pos1)
if len(trim(ls_temp))<>2 or isnull(trim(ls_temp)) or trim(ls_temp)='' then lb_macflag=false
if li_loops<>6 then
li_pos1=li_pos2+1
li_pos2=pos(ls_mac,':',li_pos1)
if li_pos2<=0 then
if li_loops=5 then
li_pos2=len(ls_mac)+1
else
lb_macflag=false
end if
else
if li_loops=5 then
lb_macflag=false
end if
end if
end if
next
if lb_macflag=true then
ls_macdata=''
for li_loops=1 to len(data)
ls_temp=mid(data,li_loops,1)
if not isnumber(ls_temp) then
ls_temp=upper(ls_temp)
if (Asc ( ls_temp ) >= asc('A') and Asc ( ls_temp ) <= asc('F')) or (Asc ( ls_temp ) >= asc('0') and Asc ( ls_temp ) <= asc('9')) or asc(ls_temp)=asc(':') then
lb_macflag = true
else
lb_macflag = false
exit
end if

end if
ls_macdata=ls_macdata+ls_temp
next

end if

if lb_macflag=false then
Messagebox("提示","您第"+string(row)+"行输入了错误格式的MAC值!")
return 1
end if
allen_lc 2006-09-11
  • 打赏
  • 举报
回复
不知道判断ASCII 可不可以做到
li_d_s 2006-09-11
  • 打赏
  • 举报
回复
editmask,mask有个设定是可以只为字母表的说
仰天长啸qsx 2006-09-11
  • 打赏
  • 举报
回复
可通过输入字符的 ASCII 码判断。pb中函数Asc ( string )
zsforever 2006-09-11
  • 打赏
  • 举报
回复
数据库中的问题吧,添加约束

1,077

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧