-1

我正在使用两个子例程。

第一个处理现有记录。第二个显示第一个的实时更新。

我想将第二个 sub 中的传入数据关联回第一个

我尝试过使用公共变量,但这似乎不起作用。

在 sub 2 我有传入的数据:

dim lp as integer
lp = last_update 'the data fresh from the server updating in real time

现在我想获取 'lp' 中的信息并将其用于其上方的 sub 中进行数据处理:

revised_data = lp

不知道该怎么做

提前谢谢了

4

2 回答 2

0

我会用Sub上面lp的参数之一来调用它:

Public Sub AboveSub(ByVal param1 as String) 'Or whatever lp is
    Dim revised_data as String = param1
End Sub

然后调用它

AboveSub(lp)
于 2013-10-03T01:32:29.097 回答
0

尝试这样的事情:

Public Sub FirstSub()
    dim lp as integer
    lp = last_update 'the data fresh from the server updating in real time
    SecondSub(lp) ' <-- this is the call to your second sub it passes `lp` in
End Sub

Public Sub SecondSub(lp_passed_in as integer)
    ' ...
    revised_data = lp_passed_in
    ' ...
End Sub
于 2013-10-03T01:35:00.223 回答