FrostByte
Messages postés138Date d'inscriptionmercredi 4 avril 2001StatutMembreDernière intervention28 janvier 2006
-
9 févr. 2004 à 17:56
cs_rene38
Messages postés1858Date d'inscriptionsamedi 29 juin 2002StatutMembreDernière intervention17 octobre 2013
-
9 févr. 2004 à 20:08
bonjour les gens !!!! ;) j'ai des petits pbs avec un petit redim lorsque je tente un redim sur un tableau en 2 d j'obtiens une erreure indice en dehors de plage (N°9), et pourtant j'ai cherché sur le forum mais rien n'a su m'aidé !!
Public LogFile As String
Public tempFile As String
Public tempFolder As String
Public tempFN As String
Dim tabExt() As Long
Private Sub CmdSelEx_Click()
Dim i As Integer, k As Integer, j As Integer
Dim Chaine As String, test As String
Dim Testb As Boolean
Testb = True
Do
Open tempFolder & LstFile.List(j) For Input As #1
j = j + 1
While Not EOF(1)
Input #1, Chaine
If Chaine <> "[Extensions]" Then
Do
If Right(Left(Chaine, k), 1) = "=" Then
'MsgBox Left(Chaine, k - 1)
LstExt.AddItem Left(Chaine, k - 1)
tabExt(i, j) = tabExt(i, j) + Int(Right(Chaine, Len(Chaine) - k))
'MsgBox "extension : " & Left(Chaine, k - 1) & " nb : " & tabExt(i)
k = k + 1
Else
k = k + 1
'MsgBox Right(Left(Chaine, k), 1)
'MsgBox Right(Chaine, Len(Chaine) - k)
End If
Loop Until Right(Left(Chaine, k - 1), 1) = "="
k = 0
End If
i = i + 1
If Testb <> False Then
ReDim Preserve tabExt(1 To i, 1 To LstFile.ListCount) <----erreur
End If
Wend
Close #1
i = 0
Testb = False
Loop Until j = LstFile.ListCount
End Sub
cs_labout
Messages postés1356Date d'inscriptionsamedi 8 décembre 2001StatutMembreDernière intervention23 octobre 20068 9 févr. 2004 à 18:46
labout
Il faut dimensionner le tableau avant. Un tableau multidimensionnel ne peut être agrandi.
Il suffit de prevoir large puis ensuite on ne prends que les éléments non vides.