VB en fonction de plusieurs sorties - affectation des résultats

Je sais il n'y a pas de façon simple pour l'affectation multiple de la fonction dans la VB, mais il y a ma solution - c'est bon, comment voulez-vous faire mieux?

Ce dont j'ai besoin (comment aurais-je le faire en python, juste un exemple)

def foo(a)    ' function with multiple output
    return int(a), int(a)+1

FloorOfA, CeilOfA = foo(a) 'now the assignment of results

Comment je le fais en 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)
Il n'y a pas de raison d'utiliser CInt(nA) quand nA est déjà un Integer.

OriginalL'auteur Intelligent-Infrastructure | 2013-05-08