Information générale
Catégorie:
Codage, syntaxe et commandes
Hi Agnes...
The Scan...EndScan is specific used to move the record pointer throught the current table(with out 'Skip' Command) and execute a block of commands for each record that meets the specified condition(s)
Sample:
SCAN
IF Salary>=4000
REPLACE Salary WITH Salary * .10
ENDIF
ENDSCAN
...
The same code sample using DO WHILE...ENDDO
DO WHILE .T.
IF Salary>=4000
REPLACE Salary WITH Salary * .10
ENDIF
SKIP
IF EOF()
EXIT
ELSE
LOOP
ENDDO
ENDDO
Because DO WHILE...ENDDO is used generaly to: Execute a block of statements withing a conditional Loop, The statements placed between DO WHILE...ENDDO are executed while "Do While " is evaluated to true(.T.)
Resume :
Scan...Endscan : For each record in the current table apply this...
Do While...Enddo: While the is set to .T. apply this...
Wilfredo P.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement