Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FOR NEXT and Event()
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00023029
Message ID:
00033647
Vues:
49
> >I have a FOR NEXT which is going like this. > > > >FOR lnCompteur=1 TO 100 > > Send('Something') > > ... > >NEXT > > > >The Send() method is sending a string to a server. This sent string will > make the server send a reply back which will arrive in a Receive() event. > > > >I can't continue with the second FOR NEXT loop until the Receive() event > has fired. So, for each 100 send, I need to wait for the Receive() event to > loop and continue with the next send. > > > >I tried this but this was locking the CPU and the Receive() event was > never fired. > > > >FOR lnCompteur=1 TO 100 > > Send('Something') > > llReady=.F. > > * We assume the Receive() event will make llReady=.T. > > DO WHILE NOT llReady > > ENDDO > >NEXT This may be similar to a common loop in the days of 2.6: do while not rlock() enddo This loop would constantly hit the server asking for record locks. The server got so busy denying locks that it appeared to be frozen to all users. The solution was a tip that I published a few months ago: if not rlock() do while (not rlock()) and (inkey(.1)=0) enddo endif This may be the same type of thing with your Receive() function. Try adding the INKEY() delay to the DO WHILE loop. /Paul -- Paul Russell Software Kinetics Ltd. | Phone: (902) 481-4582 Fax: (902) 468-3679 201 Brownlow Avenue | Office: Paul.Russell@SofKin.ca Dartmouth | "The best evidence that time travel will never be Nova Scotia, Canada | possible is that we have not been invaded by B3B 1W2 | hordes of tourists from the future." - S. Hawking "Use technology because it's appropriate -- except in the case of 'Java' then just use it 'cause it's cool!" - Paul Russell
Paul Russell
EMail: prussell@fox.nstn.ca
Phone: (902) 499-5043
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform