字段是varchar的 怎样去掉 用户部小心输入的空格
------解决方案--------------------
在数据窗口的updatestart事件里,对输入的内容时行检查
long ll_row, ll_cnt
string ls_text
ll_cnt = this.rowcount()
for ll_row = 1 to ll_cnt
ls_text = dw_1.getitemstring(ll_row, "列名")
ls_text = trim(ls_text) //去掉两边的空格
dw_1.setitem(ll_row, "列名", ls_text)
next
即可
如果你想把所有的空格全去掉,你可以这么写
long ll_row, ll_cnt, ll_pos
string ls_text
ll_cnt = this.rowcount()
for ll_row = 1 to ll_cnt
ls_text = dw_1.getitemstring(ll_row, "列名")
ls_text = trim(ls_text)
ll_pos = pos(ls_text, ' ')
do while ll_pos > 0
ls_text = left(ls_text, ll_pos - 1) + mid(ls_text, ll_pos + 1)
ll_pos = pos(ls_text, ' ')
loop
dw_1.setitem(ll_row, "列名", ls_text)
next