[VB]Prob ds Do While not EOF
Résolu
RDPnyX
Messages postés
157
Date d'inscription
Statut
Membre
Dernière intervention
-
Utilisateur anonyme -
Utilisateur anonyme -
A voir également:
- [VB]Prob ds Do While not EOF
- Input not supported - Forum Ecran
- Not able to play iron tv ✓ - Forum TV & Vidéo
- Do not turn off target traduction - Forum Samsung
- Samsung galaxy tab S Bloquer Downloading do not turn off target - Forum Téléphones & tablettes Android
- Signal cable not connected - Forum Ecran
2 réponses
Bonjour,
**********************************************
Tampon = Input(LOF(NumFich), #NumFich)
->>>>>Close #NumFich
PremiereChaineRch = "'"
SecondeChaineRch = ""
Debug.Print Tampon
Do While Not EOF(NumFich) ' Le fichier est fermé !
**********************************************
Ne travaille plus avec le fichier, il est fermé.
Tu possède une chaine [Tampon], alors travaille avec ...
EX.:
Dim Longueur,I As Long
Dim Carac As String
Longueur = Len(Tampon)
For I = 1 To Longueur
..Carac = Mid(Tampon,I,1)
..If ( Carac = "|" ) Then
...."Décortiquer la chaine ...
..End If
Next I
Lupin
**********************************************
Tampon = Input(LOF(NumFich), #NumFich)
->>>>>Close #NumFich
PremiereChaineRch = "'"
SecondeChaineRch = ""
Debug.Print Tampon
Do While Not EOF(NumFich) ' Le fichier est fermé !
**********************************************
Ne travaille plus avec le fichier, il est fermé.
Tu possède une chaine [Tampon], alors travaille avec ...
EX.:
Dim Longueur,I As Long
Dim Carac As String
Longueur = Len(Tampon)
For I = 1 To Longueur
..Carac = Mid(Tampon,I,1)
..If ( Carac = "|" ) Then
...."Décortiquer la chaine ...
..End If
Next I
Lupin
re:
ce fut un plaisir, et ne t'inquiète pas je cherche aussi très
souvent, parfois un oeil externe nous permets de faire des
pas. Trop concentré sur un problème posé, on n'y voit plus
rien!
je serais tenter par quelque chose du genre :
Dim Chaine(50) As String
Dim NbrChaine As Integer
Dim Position as Integer
Dim Flag As Boolean
NbrChaine=0
Flag = True
Longueur = Len(Tampon)
While (Flag)
..For I = 1 To Longueur
....Carac = Mid(Tampon,I,1)
....If ( Carac = "|" ) Then
......Position = I
......NbrChaine = (NbrChaine + 1)
......Chaine(NbrChaine) = Mid(Tampon,1,Position)
......Tampon = Mid(Tampon, (Position+1))
......I = (Longueur +1) ' Sortie de la boucle
....End If
..Next I
..Longueur = Len (Tampon)
..If (Longueur < 1) Then
....Flag = False
..End IF
Wend
For I = 1 To NbrChaine
..MsgBox Chaine(I)
Next I
Un petit bout de code le matin, rien de tel pour se réveiller :)
Lupin
ce fut un plaisir, et ne t'inquiète pas je cherche aussi très
souvent, parfois un oeil externe nous permets de faire des
pas. Trop concentré sur un problème posé, on n'y voit plus
rien!
je serais tenter par quelque chose du genre :
Dim Chaine(50) As String
Dim NbrChaine As Integer
Dim Position as Integer
Dim Flag As Boolean
NbrChaine=0
Flag = True
Longueur = Len(Tampon)
While (Flag)
..For I = 1 To Longueur
....Carac = Mid(Tampon,I,1)
....If ( Carac = "|" ) Then
......Position = I
......NbrChaine = (NbrChaine + 1)
......Chaine(NbrChaine) = Mid(Tampon,1,Position)
......Tampon = Mid(Tampon, (Position+1))
......I = (Longueur +1) ' Sortie de la boucle
....End If
..Next I
..Longueur = Len (Tampon)
..If (Longueur < 1) Then
....Flag = False
..End IF
Wend
For I = 1 To NbrChaine
..MsgBox Chaine(I)
Next I
Un petit bout de code le matin, rien de tel pour se réveiller :)
Lupin
sinon, ton code va m'aider, pr le moment, ajouté à celui que j'avais, ça me ressors que la premiere chaine (Documents and Settings\) mais ne t'embetes pas à chercher, je vais le faire moi meme.
merci encore pr ta réponse.