Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1228807
  • 博文数量: 788
  • 博客积分: 4000
  • 博客等级: 上校
  • 技术积分: 7005
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-19 15:52
文章存档

2017年(81)

2011年(1)

2009年(369)

2008年(337)

分类:

2009-02-11 16:54:28



实验中有一段组织查询条件的过程(窗口中有ckbM,   ckbF作为男女选择的)  
  procedure   TfmAA.Condition();  
  var  
      sNo1,   sNo2:   string;//学号,范围  
        sNocondit:string;//查询条件的‘学号’部分  
        s:string;     //查询条件的'性别'部分  
  begin  
        sNo1:=Trim(edtNo1.Text);  
        sNo2:=Trim(edtNo2.text);  
      if   StrToInt(sNo1)>StrToInt(sNo2)   then  
        begin  
            sNo1:=Trim(edtNo2.Text);  
            sNo2:=Trim(edtNo1.Text);  
        end;  
      sNoCondit:=_______________;                                       //(1)  
      if   _____________________   then//男女都选             //(2)  
          s:=''  
      else  
          begin  
                if   ckbM   Checked   then     //只选男  
                    s:='   AND   Sex   =   ''M''';  
                  else  
                    s:='   AND   Sex=''F''';  
          end;  
    if   _____________   then       //男女都不是                       //(3)  
        s:=   '   AND   (Sex=   ''''   OR   Sex   =   ''   '')';  
      sCondit:=sNoCondit   +   s;  
  end;  
   
   
  请问上面的三个空是怎么填的呀  
 

如果学号字段为No  
  1   '(No>='+   sNo1+   '   AND   No<='+   sNo2+   ')';  
  2   ckbM.Checked   and   ckbF.Checked  
  3   (not   ckbM.Checked)   and   (not   ckbF.Checked)

楼上正解

是不是你们要考试了的题目啊?

阅读(255) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~