utiliser un tableau dans une structure
Bonjour
j'ai constitué une structure publique qui contient deux tableau tableau que je veux remplir a l'aide d'une fonction mais le compilateur m'affiche cette erreur
Citation:
L'exception NullReferencesException n'a pas été gérée, la reference d'objet n'est pas definie a une instance d'objet
voici ma structure
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| Public Structure information
Dim tentatives As Integer
Dim operateurs As String
Dim country As String
Dim int_outband As String
Dim succes As String
Dim type_erreur() As String
Dim nombre_erreur() As Integer
Dim origines As String
Dim destinations As String
Dim tcapops As String
End Structure |
j'ai fait un module afin de déclarer ma structure publique
Code:
1 2 3
| Module declaration_globale
Public tableau_structure As New List(Of information)
End Module |
après il y a un programme principale qui fait appel a la fonction suivante et dans laquelle figure l'erreur
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| Public Sub chercher_operateur_end_erreur(ByVal origine As String, ByVal destination As String, ByVal tcap_error As String, ByVal appl_context As String, ByVal tcap As String)
Dim flag_erreur As Boolean = False
Dim fifi As New information
For k = 0 To tableau_structure.Count - 1
If tableau_structure(k).operateurs = fifi.operateurs And tableau_structure(k).country = fifi.country And tableau_structure(k).int_outband = fifi.int_outband Then
fifi.nombre_erreur = tableau_structure(k).nombre_erreur
fifi.type_erreur = tableau_structure(k).type_erreur
' l'erreur commence a partir de la ligne ci dessous
For h As Integer = 0 To tableau_structure(k).nombre_erreur.Length - 1
If tcap_error = tableau_structure(k).type_erreur(h) Then
fifi.nombre_erreur(h) = tableau_structure(k).nombre_erreur(h) + 1
tableau_structure.Remove(tableau_structure(k))
tableau_structure.Insert(k, fifi)
flag_erreur = True
End If
Next
If flag_erreur = False Then
'je cree une nouvelle case dans les deux tableau
fifi.nombre_erreur(tableau_structure(k).nombre_erreur.Length + 1) = 1
fifi.type_erreur(tableau_structure(k).type_erreur.Length + 1) = tcap_error
tableau_structure.Remove(tableau_structure(k))
tableau_structure.Insert(k, fifi)
End If
End If
Next
End Sub |
Merci de m'aider