Foxtable(狐表)用户栏目专家坐堂 → 哪组代码高效


  共有2449人关注过本帖平板打印复制链接

主题:哪组代码高效

帅哥哟,离线,有人找我吗?
tld
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:739 积分:7694 威望:0 精华:0 注册:2017/2/3 10:29:00
哪组代码高效  发帖心情 Post By:2020/2/26 2:48:00 [只看该作者]

老师好。下面的两组代码,哪个更高效些?
第一组:
 dim bh as string =e.row("编号")
 for each dr as row in tables("表A").rows
      if dr("编号")=bh then
           dr.checked = true
     end if
 next
第二组:
 dim bh as string =e.row("编号")
 dim drs as list(of datarow) =datatables("表A").select("[编号]='" & bh & "'")
 for each dr as datarow in drs
         dim index as integer = tables("表A").findrow(dr)
         tables("表A").rows(index).checked = true
 next


[此贴子已经被作者于2020/2/26 3:07:47编辑过]

 回到顶部