1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Const ForReading = 1
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("c:\Ordinateurs.txt", ForReading)
st=f.ReadAll
Tab = split(st,vbcrlf)
MsgBox "Lecture des lignes Impaires",64,"Lecture des lignes Impaires"
'lbound(Tab):reprsente le plus bas indice du tableau càd le 1er indice i=0
'ubound(Tab):reprsente le plus grand indice du tableau
For i = lbound(Tab) to ubound(Tab) step 2
j=i+1
MsgBox "La ligne N° " & j & " avec l'indice "& i &_
" dans le Tableau contient la valeur : "&Tab(i),64,"Lecture des lignes Impaires"
Next
MsgBox "Lecture des lignes paires",64,"Lecture des lignes paires"
'ici on commence la boucle d'indice i=1 càd 2ème indice du tableau
For i = 1 to ubound(Tab) step 2
k=i+1
MsgBox "La ligne N° " & k & " avec l'indice "& i &_
" dans le Tableau contient la valeur : "&Tab(i),64,"Lecture des lignes paires"
Next |
Partager