以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  公式判断  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=148781)

--  作者:seal51
--  发布时间:2020/4/15 11:58:00
--  公式判断
如果字段A为空, 则字段C=A+B 不运算
如果字段A不为空, 则字段C=A+B, 如果清空字段A,则字段C的计算结果清空
这个代码如何写呢?

--  作者:有点蓝
--  发布时间:2020/4/15 12:01:00
--  
参考:http://www.foxtable.com/webhelp/topics/0595.htm
--  作者:seal51
--  发布时间:2020/4/15 12:08:00
--  
If A <> Nothing Then
    SystemReady = False
    Dim C =A+B
    e.DataRow("C") =C
    SystemReady = True
End If
这样写可否
但字段A为空的时候,如何清空字段C呢?

--  作者:有点蓝
--  发布时间:2020/4/15 14:11:00
--  
if e.DataRow.isnull("A")  then
   e.DataRow("C") = nothing
else
e.DataRow("C") = e.DataRow("A") + e.DataRow("B") 
endif