以下是引用laowan001在2022-4-29 09:57:19的发言:
如题
text to
*/&& 是否可以写类似程序中这种注释
endtext
要看你使用环境
TEXT TO s1 NOSHOW PRETEXT 4
?"带注销"
*!* VFP的注销
?"带了"
ENDTEXT
EXECSCRIPT(s1)
*!* SQL多条件拼接语句
w1 = thisform.text1.value
w2 = thisform.text2.value
wh = ""
if !empty(w1)
wh = iif(empty(wh),"字段1="+"'" + w1 + "'",wh + " and 字段1="+"'" + w1 + "'")
endif
if !empty(w2)
wh = iif(empty(wh),"字段2="+"'" + w2 + "'",wh + " and 字段2="+"'" + w2 + "'")
endif
if !empty(wh)
wh = " where " + wh
endif
TEXT TO s2 NOSHOW PRETEXT 4
-- SQL 注销语句,多条件查询,
select * from 表
<< wh >>
ENDTEXT
messagebox(s2,0,"观察") && 观看多条件拼接出来的 S2 语句内容,注意红色位置的变化
sqlexec(句柄,s2,"tmp")
[此贴子已经被作者于2022-4-29 12:49编辑过]