以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  datarow改为ROW  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=150228)

--  作者:yaojun
--  发布时间:2020/5/24 16:10:00
--  datarow改为ROW

能否把如下代码里面的datatables中的datarow内容改为当前表(table)里面的当前行(row):

For Each dr As DataRow In DataTables("指令明细").Select("工序 is not null")
    Dim ary() As String = dr("工序").split("-")
    For Each s As String In ary
        Dim ndr As Row = Tables("生产指令.金工报表").addnew
        Dim a() As String = s.split("*")
        ndr("工序") = a(0)
        ndr("单价") = a(1)
        ndr("名称") = dr("名称")
ndr("计划数量") = dr("生产数量")
    Next
Next


--  作者:新福星
--  发布时间:2020/5/24 16:21:00
--  
DataTables(bm).LoadFilter="条件"
DataTables(bm).Loadtop=""
DataTables(bm).Load
For Each a As Row In Tables(bm).Rows
......
Next

--  作者:yaojun
--  发布时间:2020/5/24 16:24:00
--  

我要的是当前的行分解到当前的表,能帮忙写下完整的代码吗,谢谢

 

DataTables("指令明细").LoadFilter = " 审核=True "
DataTables("指令明细").Loadtop=""
DataTables("指令明细").Load
For Each a As Row In Tables("生产指令.指令明细").Rows
  Dim ary() As String = dr("工序").split("-")
    For Each s As String In ary
        Dim ndr As Row = Tables("生产指令.金工报表").addnew
        Dim a() As String = s.split("*")
        ndr("工序") = a(0)
        ndr("单价") = a(1)
        ndr("名称") = dr("名称")
ndr("计划数量") = dr("生产数量")
    Next
Next
Next

这个代码好像有问题

[此贴子已经被作者于2020/5/24 16:39:28编辑过]

--  作者:linyunu
--  发布时间:2020/5/24 18:29:00
--  
Dim r as row = Tables("指令明细").Current
if r isnot nothing then
    Dim ary() As String = r("工序").split("-")
    For Each s As String In ary
        Dim ndr As Row = Tables("生产指令.金工报表").addnew
        Dim a() As String = s.split("*")
        ndr("工序") = a(0)
        ndr("单价") = a(1)
        ndr("名称") = dr("名称")
ndr("计划数量") = dr("生产数量")
    Next
end if

--  作者:有点蓝
--  发布时间:2020/5/24 22:16:00
--  
截图说明一下问题