Bonjour
je n'arrive pas a passer l'objet myAL a la fonction PrintValues .
ca commence a salement m'enerver !
j'ai besoin d'aide SVP.
je n'arrive pas a passer l'objet myAL a la fonction PrintValues .
ca commence a salement m'enerver !
j'ai besoin d'aide SVP.
Code:
Sub Main1()
' Creates and initializes a new ArrayList.
'Dim myAL As New ArrayList()
Dim myAL As Object
Set myAL = CreateObject("System.Collections.ArrayList")
Dim index As Integer
myAL.Add ("01001000")
myAL.Add ("10000111")
myAL.Add ("00000101")
myAL.Add ("00010100")
myAL.Add ("00111001")
myAL.Add ("00101111")
myAL.Add ("00000011")
myAL.Add ("00000001")
myAL.Add ("11111111")
' Displays the values of the ArrayList.
Debug.Print "The ArrayList initially contains the following values:"
Debug.Print myAL.Item(0)
For index = 0 To myAL.Count - 1
Debug.Print "myAL:"; myAL.Item(index) & " num: " & index
Next
' Sorts the values of the ArrayList.
myAL.Sort
Debug.Print "myAL Sorted:"
' Displays the values of the ArrayList.
For index = 0 To myAL.Count - 1
Debug.Print "myAL:"; myAL.Item(index) & " num: " & index
Next
PrintValues (myAL)
End Sub 'Main
Function PrintValues(myALx As Object)
'Function PrintValues(ByRef myALx As Object)
'Function PrintValues( myALx As ArrayList)
'Function PrintValues( myALx As "System.Collections.ArrayList")
'Function PrintValues(myALx As System.Collections.ArrayList)
Dim i As Integer
For index = 0 To myALx.Count - 1
Debug.Print "myAL:" & myALx.Item(i) & " num: " & i
Next
End Function 'PrintValues