This is a process control command, i.e., it will control whether a command, or group of commands will be executed. This is one part of a complete command structure.
WHILE lexpr | Required - If the expression resolves to .TRUE., the command lines between the WHILE command and the next LOOP_IF, EXIT, EXIT_IF or ENDW (Endwhile) command will be executed. |
COMMENTS
For more information on the different structured programming commands, and the WHILE command in particular, please see Structured Programming Commands.
SEE ALSO
EXIT, EXIT_IF, LOOP, LOOP_IF, ENDW
Sample
// FYI problem to change this if you try to change using a scan the program will only change one record.
// reason for this is that the key position some how changes when saved and your at the end of your while.
// Below is a while loop using a findv. If you try to scan and it will not work try this example.
while .t.
findv m fnum custsale_hndl key cust_sale_code value old_cust
if flerr(custsale_hndl) <> 0 .o. cust_sale_code <> old_cust then exit
'@progressbar1.position' = REC_PERCENTAGE(custsale_hndl)
CUST_SALE_CODE = new_cust
save @custsale_hndl nocnf
endw
close @custsale_hndl