Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DO WHILE vs SCAN WHILE...?
Message
De
24/06/2005 02:14:05
 
 
À
23/06/2005 19:42:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01026042
Message ID:
01026170
Vues:
14
>>What would be the difference in using DO WHILE vs SCAN WHILE...?
>>Is there a performance issue?
>>
>>Thanks in advance, M.
>My preference is for SCAN. In addition to what has been said, I think it is slightly cleaner especially if you have both a WHILE and FOR clause.
>
>One thing to be aware of, however. Nested SCANs do not work as expected because of the extra SKIP at the second ENDSCAN.


Here is workaround shown on Dragan's code .
scan 
   <...some code>
      
      scan while &WhileCondition
         <more code>

           scan while &InnerWhileCondition
              <more code>
           endscan   
           skip -1   && Workaround to 'rewind' table one skip back

      endscan   
      skip -1        && will do the trick

endscan   
Nested scans will work properly like this.

Also, additional FOR clauses in inner scans might 'mess up'
smooth, top to bottom flow in above scenario

Rgds++
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform