cs_tulesais
Messages postés175Date d'inscriptionmercredi 2 juin 2004StatutMembreDernière intervention11 avril 2013
-
21 oct. 2005 à 15:26
cs_tulesais
Messages postés175Date d'inscriptionmercredi 2 juin 2004StatutMembreDernière intervention11 avril 2013
-
21 oct. 2005 à 15:59
Bonjour,
pourriez vous m'aider à simplifier ce code :
. lecture d'un fichier texte pour connaître le nombre de lignes max (longueur variables)
. redimensionnement de ma table mémoire avec le nombre de lignes max
. relecture du fichier pour mise en mémoire dans la table mémoire
open fic for input lock read write as #1
t_ind_max = 0
do while not eof(1)
t_ind_max = t_ind_max + 1
line input #1, w_temp
loop
redim t(t_ind_max)
t_ind = 0
seek #1,1
do while not eof(1)
t_ind = t_ind +1
line input #1, t(t_ind)
loop
cs_CanisLupus
Messages postés3757Date d'inscriptionmardi 23 septembre 2003StatutMembreDernière intervention13 mars 200621 21 oct. 2005 à 15:44
Salut,
Un tit exemple :
Dim t() As String
Dim t_ind As Integer
Dim w_temp As String
Dim fic As String
fic = "c:\temp\truc.txt"
ReDim t(0)
Open fic For Input Lock Read Write As #1
Do While Not EOF(1)
Line Input #1, w_temp
t_ind = t_ind + 1
ReDim Preserve t(t_ind)
t(t_ind) = w_temp
Loop
Close #1
' pour lire le tableau
For t_ind = 1 To UBound(t)
MsgBox t(t_ind)
Next
Tu vois si ça répond à ta question
-------------------------------------------------
Dresseur de puces, .... normal pour un loup !?