欢迎来到传世资源网!
加载中...
正在加载,请耐心等待...
本站为收藏、学习站,如有侵权,请联系管理员删除!

Delphi条件个数不定的判断

介绍 评论 失效链接反馈

【例子介绍】Delphi条件个数不定的判断

【相关图片】

from clipboard

【源码结构】var
  Bln:boolean;
  p:byte;
  Arr:array of string;
  TS:Tstringlist;
  TJStr,TJVal,tmp,sname:string;
begin
  meo.Clear;
  rcount:=grid.RowCount;

  ts:=tstringlist.Create;
  ncount:=checklist.Items.Count;
  for n:= 0 to nCount-1 do
    begin
      if checklist.Checked[n]=true then
        ts.Add(checklist.Items.Strings[n]);
    end;
  ncount:=ts.count;
  if ncount=0 then exit;

  meo.Lines.Add('符合条件的如下:');
  setlength(arr,ncount);
  for n:= low(arr) to high(arr) do
    arr[n]:=ts[n];

  for r:=1 to rcount-1 do
    begin
      bln:=true;
      for n:= low(arr) to high(arr) do
        begin
          tmp:=arr[n];
          p:=pos('=',tmp);
          TJStr:=copy(tmp,1,p-1);
          if TJStr='技术' then
            f:=2
          else if TJStr='种类' then
            f:=3
          else if TJStr='级别' then
            f:=4
          else if TJStr='派系' then
            f:=5;
          TJVal:=copy(tmp,p 1,length(tmp)-p);
          if trim(grid.Cells[f,r])<>TJVal then
            begin
              bln:=false;
              break;
            end;
        end;
      if bln=true then
        meo.Lines.Append('    ' grid.Cells[1,r]);
  end;

  meo.Refresh;

下载声明:

本站资源均有第三方用户自行上传分享推荐,非本站自制,仅供玩家做交流学习之用!切勿用于商业用途!游戏作品版权归原作者享有,如有版权问题,请附带版权证明至邮件,本平台将应您的要求删除。
相关推荐:

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复