Module Module1
Sub Main()
Dim arr() As Integer
arr = f()
For Each element As Integer In arr
Console.Write("{0, 3}", element)
Next
End Sub
Function f() As Integer()
Dim arr() As Integer = {1, 2, 3, 4, 5}
arr(0) = 777
Return arr
End Function
End Module
'run:
'
' 777 2 3 4 5