我知道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