General information
Category:
Coding, syntax & commands
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.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only