pb sur comparaison de 2 fichier text

pb sur comparaison de 2 fichier text - VB/VBA/VBS - Programmation

Marsh Posté le 16-07-2004 à 16:50:28    


voici mon code j'ai un probleme car il reste dans ma 2éme boucle il ne ve pas sortir pouvez vous m'aider
 
dim nom, prenom, classe, total          
dim nom1, prenom1, classe1, total1
dim pb
 
set fs = CreateObject("Scripting.FileSystemObject" )
set ff = fs.GetFile("Comptes1.txt" )
set t = ff.OpenAsTextStream(1, -2)
 
do
 q = t.ReadLine   'Read a line in the file, put the line in s
    fields = Split(q, ";" )  'Separate the fields and put them in the array fields
 nom1 = trim(fields(0))
    prenom1 = trim(fields(1))
     classe1 = trim(fields(2))
    'wscript.echo ("NOM 1 " + nom1)
    'wscript.echo ("PRENOM 1 " +prenom1)
    'wscript.echo ("Statuts 1 " +classe1)
 total1=nom1+prenom1
 
 
set fso = CreateObject("Scripting.FileSystemObject" )
set f = fso.GetFile("Comptes2.txt" )
set ts = f.OpenAsTextStream(1, -2)
 
do  
 
 s = ts.ReadLine   'Read a line in the file, put the line in s
    fields = Split(s, ";" )  'Separate the fields and put them in the array fields
 nom = trim(fields(0))
    prenom = trim(fields(1))
     classe = trim(fields(2))
    'wscript.echo ("NOM 2 " + nom)
    'wscript.echo ("PRENOM 2 " +prenom)
    'wscript.echo ("Statuts 2 " +classe)
 total=nom+prenom
 
 if (total1 = total) then
  pb="sortir"
  wscript.echo ("bon "+total)
   
 Else  
  pb="delete"
  wscript.echo ("Pas bon " +total +" et "+total1)
 End If
       
loop While ((Not ts.AtEndOfStream) Or (Not pb="sortir" ))
 
loop While (Not t.AtEndOfStream)

Reply

Marsh Posté le 16-07-2004 à 16:50:28   

Reply

Marsh Posté le 16-07-2004 à 16:56:38    

c'est pas  

Citation :

loop While ((Not ts.AtEndOfStream) And (Not pb="sortir" ))


plutot que  

Citation :

loop While ((Not ts.AtEndOfStream) Or (Not pb="sortir" ))


?


---------------
"I wonder if the internal negative pressure in self pumping toothpaste tubes is adjusted for different market altitudes." John Carmack
Reply

Marsh Posté le 16-07-2004 à 17:09:18    

merci c'etait bien ca mon erreur

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed