我快废了!!!!!!!!!!!帮帮我!!!!!!!!!!!!!!

mimi_2000 2001-11-28 08:09:05
我的下列程序编译时无错可是执行时系统总显示::::::::::::::
EXPRESSION IS NOT VALID
代码如下::::::::::::::::string lookforcondition
string lookforitem1,lookforitem2,lookforitem3
string lookforhow1,lookforhow2,lookforhow3
string lookforwhat1,lookforwhat2,lookforwhat3
string lookforoperator1,lookforoperator2,lookforoperator3

lookforhow1=ddlb_2.text
lookforhow2=ddlb_5.text
lookforhow3=ddlb_8.text
if ddlb_3.text="与" then
lookforoperator1="and"
elseif ddlb_3.text="或" then
lookforoperator1="or"
elseif ddlb_3.text="非" then
lookforoperator1="not"
end if
if ddlb_6.text="与" then
lookforoperator2="and"
elseif ddlb_6.text="或" then
lookforoperator2="or"
elseif ddlb_6.text="非" then
lookforoperator2="not"
end if

if ddlb_1.text="墓主姓名" then
lookforitem1="mzxm"
lookforwhat1="'"+sle_1.text+"'"
elseif ddlb_1.text="墓位编号" then
lookforitem1="mwbm"
lookforwhat1="'"+sle_1.text+"'"

elseif ddlb_1.text="安葬日期" then
lookforitem1="azrq"
lookforwhat1="'"+sle_1.text+"'"
elseif ddlb_1.text="购置人姓名" then
lookforitem1="gzrxm"
lookforwhat1="'"+sle_1.text+"'"
elseif ddlb_1.text="身份证号" then
lookforitem1="sfzh"
lookforwhat1="'"+sle_1.text+"'"
elseif ddlb_1.text="购置人电话" then
lookforitem1="gzrdh"
lookforwhat1="'"+sle_1.text+"'"
end if

if ddlb_4.text="墓主姓名" then
lookforitem2="mzxm"
lookforwhat2=sle_2.text
elseif ddlb_4.text="墓位编号" then
lookforitem2="mwbm"
lookforwhat2="'"+sle_2.text+"'"

elseif ddlb_4.text="安葬日期" then
lookforitem2="azrq"
lookforwhat2="'"+sle_2.text+"'"
elseif ddlb_4.text="购置人姓名" then
lookforitem2="gzrxm"
lookforwhat2="'"+sle_2.text+"'"
elseif ddlb_4.text="身份证号" then
lookforitem2="sfzh"
lookforwhat2=sle_2.text
elseif ddlb_4.text="购置人电话" then
lookforitem2="gzrdh"
lookforwhat2="'"+sle_2.text+"'"
end if

if ddlb_7.text="墓主姓名" then
lookforitem3="mzxm"
lookforwhat3="'"+sle_3.text+"'"
elseif ddlb_7.text="墓位编号"then
lookforitem3="mwbm"
lookforwhat3="'"+sle_3.text+"'"

elseif ddlb_7.text="安葬日期" then
lookforitem3="azrq"
lookforwhat3="'"+sle_3.text+"'"
elseif ddlb_7.text="购置人姓名" then
lookforitem3="gzrxm"
lookforwhat3="'"+sle_3.text+"'"
elseif ddlb_7.text="身份证号" then
lookforitem3="sfzh"
lookforwhat3="'"+sle_3.text+"'"
elseif ddlb_7.text="购置人电话" then
lookforitem3="gzrdh"
lookforwhat3="'"+sle_3.text+"'"
end if
if ddlb_1.text="" or ddlb_2.text="" then
elseif ddlb_4.text="" or ddlb_5.text="" then
lookforcondition=lookforitem1+lookforhow1+""+lookforwhat1+""
elseif ddlb_7.text="" or ddlb_8.text="" then
lookforcondition=lookforitem1+lookforhow1+""+lookforwhat1+""+lookforoperator1+" "+lookforitem2+lookforhow2+""+lookforwhat2+""
else
lookforcondition=lookforitem1+lookforhow1+""+lookforwhat1+""+lookforoperator1+" "+lookforitem2+lookforhow2+""+lookforwhat2+""+lookforoperator2+" "+lookforitem3+lookforhow3+""+lookforwhat3+""
end if
w_mwcx.dw_1.setfilter(lookforcondition)
filter(dw_1)
dw_1.retrieve()

...全文
38 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
chinalht 2001-11-28
  • 打赏
  • 举报
回复
function uf_combine( string col, string tj, string data ) return string
{
string ls_col[] = {'mzxm','mwbh','azrq','gzrxm',sfzh','gzrdh'}
string ls_txt[] = {'墓主姓名','墓位编号','安葬日期','购置人姓名','身份证号','购置人电话'}
long i
if col = '' or tj = '' then return ''
for i = 1 to upperbound( ls_txt )
if col = ls_txt[i] then
//这几列如果都是字符串类型,就可以否则要判断.
return '(' + ls_col[i] + ' ' + tj + " '" + data + "')"
end if
next
return ''
}

string ls_tj, ls_condition = ''
ls_condition = uf_combine( ddlb_1.text, ddlb_2.text, sle_1.text )
if ls_condition <> '' then
ls_tj = uf_combine( ddlb_4.text, ddlb_5.text, sle_2.text )
if ls_tj <> '' then
ls_condition = ls_condition + ' ' + ddlb_3.text + ' ' + ls_tj
ls_tj = uf_combine( ddlb_7.text, ddlb_8.text, sle_3.text )
if ls_tj <> '' then ls_condition = ls_condition + ' ' + ddlb_6.text + ' ' + ls_tj
end if
end if
dw_1.setfilter( ls_condition )
dw_1.retrieve( )
另外: 你显示 lookforcondition 看看
mimi_2000 2001-11-28
  • 打赏
  • 举报
回复
UP!!!!!!!!!!!!!!!!!!!1

1,075

社区成员

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

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