以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  怎么写成内部函数  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=44018)

--  作者: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

 

 


--  作者:逛逛
--  发布时间: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
--  发布时间: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)

 

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


--  作者:逛逛
--  发布时间: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

 

想要这样?


--  作者:有点甜
--  发布时间: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")