以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  求一个算法  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=137136)

--  作者:有点甜
--  发布时间:2019/6/28 14:47:00
--  

参考代码

 

Dim t As Table = Tables("表A")
Dim st As Date = #00:00#
For Each r As Row In t.Rows
    If r("第三列") <> Nothing Then
        If st < r("第三列") Then
            Dim nr As Row = t.addnew
            nr("第三列") = st
            nr("第四列") = r("第三列").addminutes(-1)
            st = r("第四列").addminutes(1)
            nr.Move(r.Index)
        Else
            st = r("第四列").addminutes(1)
        End If
    End If
Next