以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  关于取余数该如何运用  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=133074)

--  作者:firehell
--  发布时间:2019/4/5 23:03:00
--  关于取余数该如何运用
例如我有AB两列,                               A列为已有数据(0、1、2、3、4、5、6、7、8、9、10)  
B列希望能自动根据A列的数据 除以4后取其余数,就变成(0、1、2、3、0、1、2、3、0、1、2)

不知道该如何实现

--  作者:有点蓝
--  发布时间:2019/4/6 10:46:00
--  
参考:http://www.foxtable.com/webhelp/scr/0625.htmhttp://www.foxtable.com/webhelp/scr/0218.htm

If e.DataCol.Name = "A列" Then 
  
e.DataRow.("B列") = e.NewValue mod 4
End If

--  作者:firehell
--  发布时间:2019/4/6 12:40:00
--  
好像要报错
---------------------------
错误
---------------------------
编译错误:应为标识符。



错误代码:e.DataRow.("结算式样") = e.NewValue Mod 4
---------------------------
确定   
---------------------------


--  作者:有点蓝
--  发布时间:2019/4/6 14:19:00
--  
If e.DataCol.Name = "A列" Then 
  
e.DataRow("B列") = e.NewValue mod 4
End If