主题:如果把查询结果通过表格控件显示出来
以下代码是实现在文本框中输入任意字符,连续或不连续的字符关键字,就可以查询备注型字段并显示结果,现在查询结果是一条一条的显示出来,如果想看下一个结果只能按任意键查询,我想把若干个结果通过表格显示出来,不知哪位老师可以解答?
LPARAMETERS nButton, nShift, nXCoord, nYCoord
ctext=ALLTRIM(ThisForm.Text1.Value)+SPACE(2)
nlenCtext=LEN(ctext)
IF nlenCtext=0
=MESSAGEBOX("请输入关键字......",48,"系统提示")
ThisForm.Text1.SetFocus
ENDIF
nword=0
n=1
nstart=1
nend=0
**统计文本框输入的单词个数并把单词存放在相应的变量中
**文本框中单词之间空格隔开
DO WHILE n<nlenCtext
cCh=SUBSTR(ctext,n,1)
nend=nend+1
IF ASC(SUBSTR(ctext,nend-1,1))!=32.and.asc(SUBSTR(ctext,nend,1))=32
nword=nword+1
cWordName=ALLTRIM("cword"+ALLTRIM(STR(nword)))
&cWordName=ALLTRIM(SUBSTR(ctext,nstart,nend-nstart))
nstart=nend
ENDIF
n=n+1
ENDDO
SELECT btyszwzy
GO TOP
DO WHILE .not.eof()
cTextMemo=特征 &&取出备注字段存放在变量中
cExp=""
FOR i=1 TO nword
nn="nat"+ALLTRIM(STR(i))
cWordName=ALLTRIM("cword"+ALLTRIM(STR(i)))
&nn=AT(&cWordName,cTextMemo)
cExp=cExp+"&nn>0"+".and."
ENDFOR
nlencExp=LEN(cExp)
cExp=LEFT(cExp,nLencExp-5)
IF &cExp
ThisForm.Edit3.Value=cTextMemo &&编辑框显示符合条件的内容
WAIT ""
ENDIF
SKIP
ENDDO
thisform.refresh
WAIT clear
LPARAMETERS nButton, nShift, nXCoord, nYCoord
ctext=ALLTRIM(ThisForm.Text1.Value)+SPACE(2)
nlenCtext=LEN(ctext)
IF nlenCtext=0
=MESSAGEBOX("请输入关键字......",48,"系统提示")
ThisForm.Text1.SetFocus
ENDIF
nword=0
n=1
nstart=1
nend=0
**统计文本框输入的单词个数并把单词存放在相应的变量中
**文本框中单词之间空格隔开
DO WHILE n<nlenCtext
cCh=SUBSTR(ctext,n,1)
nend=nend+1
IF ASC(SUBSTR(ctext,nend-1,1))!=32.and.asc(SUBSTR(ctext,nend,1))=32
nword=nword+1
cWordName=ALLTRIM("cword"+ALLTRIM(STR(nword)))
&cWordName=ALLTRIM(SUBSTR(ctext,nstart,nend-nstart))
nstart=nend
ENDIF
n=n+1
ENDDO
SELECT btyszwzy
GO TOP
DO WHILE .not.eof()
cTextMemo=特征 &&取出备注字段存放在变量中
cExp=""
FOR i=1 TO nword
nn="nat"+ALLTRIM(STR(i))
cWordName=ALLTRIM("cword"+ALLTRIM(STR(i)))
&nn=AT(&cWordName,cTextMemo)
cExp=cExp+"&nn>0"+".and."
ENDFOR
nlencExp=LEN(cExp)
cExp=LEFT(cExp,nLencExp-5)
IF &cExp
ThisForm.Edit3.Value=cTextMemo &&编辑框显示符合条件的内容
WAIT ""
ENDIF
SKIP
ENDDO
thisform.refresh
WAIT clear