我知道VB
中没有直接的函数多任务分配方式,但是我的解决方案是 - 它是否好,你会如何做得更好?具有多输出功能的VB函数 - 赋值结果
我需要(我会怎么做它在Python,只是一个例子)
def foo(a) ' function with multiple output
return int(a), int(a)+1
FloorOfA, CeilOfA = foo(a) 'now the assignment of results
我怎么做,在VB:
Public Function foo(ByVal nA As Integer) As Integer() ' function with multiple output
Return {CInt(nA),CInt(nA)+1}
End Function
Dim Output As Integer() = foo(nA) 'now the assignment of results
Dim FloorOfA As Integer = Output(0)
Dim CeilOfA As Integer = Output(1)
当'nA'已经是'Integer'时,没有理由使用'CInt(nA)'。 – mbomb007 2017-09-06 18:35:13