我知道对 in 中的函数进行多重分配没有直接的方法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)