* 接上,还可以这样
cmb1 = ALLTRIM()
cmb2 = ALLTRIM()
cmb3 = ALLTRIM()
cmb4 = ALLTRIM()
cwh = ""
if !empty(cmb1)
cwh = cwh + iif(!empty(cwh)," and syr LIKE ('%'+cmb1+'%')"," syr LIKE ('%'+cmb1+'%')")
endif
if !empty(cmb2)
cwh = cwh + iif(!empty(cwh)," and zcname LIKE ('%'+cmb2+'%')"," zcname LIKE ('%'+cmb2+'%')")
endif
if !empty(cmb3)
cwh = cwh + iif(!empty(cwh)," and syzt LIKE ('%'+cmb3+'%')"," syzt LIKE ('%'+cmb3+'%')")
endif
if !empty(cmb4)
cwh = cwh + iif(!empty(cwh)," and glbm LIKE ('%'+cmb4+'%')"," glbm LIKE ('%'+cmb4+'%')")
endif
if !empty(cwh)
text to str1 textmerge noshow pretext 4
SELECT * FROM ch WHERE zt<1 and ;
<<cwh>> ;
order by ... ;
into ... ;
endtext
else
text to str1 textmerge noshow pretext 4
SELECT * FROM ch WHERE zt<1 ;
order by ... ;
into ... ;
endtext
endif
execscript(str1) && 执行多行VFP命名
[此贴子已经被作者于2021-11-11 20:29编辑过]