帮我解释一下FVP语言

[复制链接]
查看11 | 回复0 | 2009-1-30 06:28:38 | 显示全部楼层 |阅读模式
USE 成绩表.dbf
if thisform.combo1.text="课程号" select *; from 成绩表.dbf ; where 成绩表.课程号=alltrim(thisform.text1.value); into cursor result
thisform.grid1.recordsource="result"
thisform.grid1.setfocus
thisform.refresh endif if thisform.combo1.text="学号"
select *; from 成绩表; where 成绩表.学号=alltrim(thisform.text1.value); into cursor result thisform.grid1.recordsource="result" thisform.grid1.setfocus thisform.refresh endif

                                                                                                这个应该是一个表单按扭的CLICK事件.这个表单有一个COMBO,一个文本框,还有一个表格.这段代码的意思是:首先,打开成绩表,第一个IF语句先看COMBO里的选项,如果是"课程号",那么就去成绩表里面查文本框输入的"课程号",并把结果输出到表单的表格上,第二个IF语句也一样.if thisform.combo1.text="课程号"&&如果是课程号select *;from 成绩表.dbf ;
where 成绩表.课程号=alltrim(thisform.text1.value);
&&在成绩表里查文本框里对应的课程号相关信息into cursor result &&存到RELSULT表thisform.grid1.recordsource="result"
&&表格的数据源设为\'RESULT\'表thisform.grid1.setfocusthisform.refresh
&&在表格里显示查寻的结果endifif thisform.combo1.text="学号" &&如果是课程号select *;from 成绩表;where 成绩表.学号=alltrim(thisform.text1.value); &&查寻学号等于TEXT1的相关信息into cursor result
&&存到\'RESULT\'thisform.grid1.recordsource="result"thisform.grid1.setfocusthisform.refresh
&&在表单的表格中显示结果endif                                       
提问者对答案的评价:
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行