Foxtable(狐表)用户栏目专家坐堂 → 怎么写成内部函数


  共有3677人关注过本帖树形打印复制链接

主题:怎么写成内部函数

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


加好友 发短信
等级:四尾狐 帖子:884 积分:7061 威望:0 精华:0 注册:2013/3/5 8:42:00
怎么写成内部函数  发帖心情 Post By:2013/12/20 18:20:00 [只看该作者]

在多个窗口的表事件需要使用这个,怎么修改成函数

 

If e.Table.Current IsNot Nothing
Dim dr As DataRow = e.Table.Current.DataRow
Dim wz As Integer = Tables("crm_sale").FindRow(dr)

If wz >=0 Then
      Tables("crm_sale").Position = wz
End If
End If

 

放到内部函数里提示不能使用e

 

 


 回到顶部
帅哥哟,离线,有人找我吗?
逛逛
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:1693 积分:12117 威望:0 精华:7 注册:2013/7/11 10:52:00
  发帖心情 Post By:2013/12/20 18:36:00 [只看该作者]

以下是引用wuxianzuoji41在2013-12-20 18:20:00的发言:

在多个窗口的表事件需要使用这个,怎么修改成函数

 

If e.Table.Current IsNot Nothing
Dim dr As DataRow = e.Table.Current.DataRow
Dim wz As Integer = Tables("crm_sale").FindRow(dr)

If wz >=0 Then
      Tables("crm_sale").Position = wz
End If
End If

 

放到内部函数里提示不能使用e

 

 

 

 

Dim tb As Table = Args(0)
If tb.Current IsNot Nothing
    Dim dr As DataRow = tb.Current.DataRow
    Dim wz As Integer = Tables("crm_sale").FindRow(dr)
    If wz >=0 Then
      Tables("crm_sale").Position = wz
    End If
End If

 

 

调用  Functions.Execute("函数名",e.Table)


 回到顶部
帅哥哟,离线,有人找我吗?
wuxianzuoji41
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:884 积分:7061 威望:0 精华:0 注册:2013/3/5 8:42:00
  发帖心情 Post By:2013/12/20 19:28:00 [只看该作者]

以下是引用逛逛在2013-12-20 18:36:00的发言:

 

 

Dim tb As Table = Args(0)
If tb.Current IsNot Nothing
    Dim dr As DataRow = tb.Current.DataRow
    Dim wz As Integer = Tables("crm_sale").FindRow(dr)
    If wz >=0 Then
      Tables("crm_sale").Position = wz
    End If
End If

 

 

调用  Functions.Execute("函数名",e.Table)

 

如果吧表的名称也加入参数该怎么写呢


 回到顶部
帅哥哟,离线,有人找我吗?
逛逛
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:1693 积分:12117 威望:0 精华:7 注册:2013/7/11 10:52:00
  发帖心情 Post By:2013/12/20 19:31:00 [只看该作者]

 

Dim tb As Table = Args(0)

Dim tb_name As string = Args(1)

If tb.Current IsNot Nothing
    Dim dr As DataRow = tb.Current.DataRow
    Dim wz As Integer = Tables(tb_name).FindRow(dr)
    If wz >=0 Then
      Tables(tb_name).Position = wz
    End If
End If

 

想要这样?


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2013/12/20 19:31:00 [只看该作者]

 如下

Dim tb As Table = Args(0)
Dim tName As String = args(1)
If tb.Current IsNot Nothing
    Dim dr As DataRow = tb.Current.DataRow
    Dim wz As Integer = Tables(tName).FindRow(dr)
    If wz >=0 Then
      Tables(tName).Position = wz
    End If
End If

调用 Functions.Execute("函数名", e.Table, "crm_sale")

 回到顶部