Msflexgrid & fichier txt

Résolu
ThomasCo Messages postés 15 Date d'inscription mardi 12 avril 2005 Statut Membre Dernière intervention 20 septembre 2007 - 18 sept. 2006 à 20:11
ahmani24 Messages postés 39 Date d'inscription mardi 13 avril 2004 Statut Membre Dernière intervention 14 novembre 2006 - 25 sept. 2006 à 15:32
Bojour a tous,
j ai un fichier texte (txt); qui contient des enregistrement de format :

a1
b1
c1

a2
b2
c2

a3
b3
c3
 
...
 comment je peux afficher son contenu dans msflexgrid avec 3 colonnes comme ca :

a1         b1          c1
a2         b2          c2
a3         b3          c3

voila mon code qui n a  pas marché:

While Not EOF(1)
    Input #1, a$
    'Combo1.AddItem a$
   
    MSFlex.Rows = i + 1
    For j = 0 To 4
        MSFlex.TextMatrix(i, j) = a$
        MSFlex.Cols = j + 1
        Input #1, a$
       
        Next j
    i = i + 1
Wend

Merci pour vos aides
Close #1

2 réponses

cs_casy Messages postés 7741 Date d'inscription mercredi 1 septembre 2004 Statut Membre Dernière intervention 24 septembre 2014 40
18 sept. 2006 à 21:38
Voila une version de ton code qui marche

Dim ff As Integer 
Dim i As Integer 
Dim j As Integer 

i =  MSFlex.Rows 
MSFlex.Cols = 4 

ff = FreeFile 
Open TonFichier For Input As #ff 

Do While Not  EOF (ff) 
    MSFlex.Rows  = i + 1 
    For j =  0 To 3 
        If Not  EOF (ff) Then 
            Input #ff, a$ 
            MSFlex.TextMatrix(i, j)  = a$ 
        Else 
            Exit Do 
        End If 
    Next j 
    i = i + 1 
Loop 

Close #ff

<small>Coloration syntaxique
automatique</small>

---- Sevyc64  (alias Casy) ----<hr size="2" width="100%" /># LE PARTAGE EST NOTRE FORCE #
3
ahmani24 Messages postés 39 Date d'inscription mardi 13 avril 2004 Statut Membre Dernière intervention 14 novembre 2006
25 sept. 2006 à 15:32
ya t il une fonction pour modifier et supprimer un enregistrement .
0
Rejoignez-nous