mario.deghetto

Visual Basic & .NET
posts - 332, comments - 79, trackbacks - 0

#24: Limite superiore e inferiore di un array

Per trovare i limiti superiore e inferiore di un array monodimensionale (vettore), in VB6 avevamo le funzioni UBound() e LBound().

Con VB.NET dobbiamo invece utilizzare due metodi messi a disposizione dall’array, cioè GetUpperBound e GetLowerBound, come nel seguente esempio:

Dim a() As Integer = {1, 2, 3}
Dim limiteSuperiore As Integer = a.GetUpperBound(0)
Dim limiteInferiore As Integer = a.GetLowerBound(0)

Print | posted on venerdì 15 gennaio 2010 5.22 |

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 5 and 4 and type the answer here:

Powered by: