Partager via


Structured Programming

These commands and functions make it possible for you to control program execution and branching within a Visual FoxPro program.

Use

To

DO CASE ... ENDCASE Command

Execute the first set of commands whose conditional expression evaluates to true (.T.). 

DO WHILE ... ENDDO Command

Execute a set of commands within a conditional loop. 

EXIT Command

Exit a DO WHILE, FOR, or SCAN loop. 

FOR EACH ... ENDFOR Command

Execute a set of commands for each element in a Visual FoxPro array or collection. 

FOR ... ENDFOR Command

Execute a set of commands a specified number of times. 

#IF ... #ENDIF Preprocessor Directive

Conditionally include source code at compile-time. 

#IFDEF | #IFNDEF ... #ENDIF Preprocessor Directive

Conditionally include a set of commands at compile time if a compile-time constant is defined. 

ICASE( ) Function

Evaluate the results from a list of conditions. 

IF ... ENDIF Command

Conditionally execute a set of commands based on the value of a logical expression.

IIF( ) Function

Return one of two values depending on the value of a logical expression. 

LOOP Command

Return program control directly to the beginning of a looping structure. 

SCAN ... ENDSCAN Command

Move the record pointer through the currently selected table and execute a block of commands for each record that meets the specified conditions. 

See Also

Other Resources

Programming

Language Categories