Partager via


IF Statements

Each language offers equivalent IF functionality. The THEN clause is allowed only on the IF statement in Visual FoxPro.

Visual FoxPro BASIC
IF nCnt < nMax
 nTot = nTot * nCnt
 nCnt = nCnt + 1
ENDIF
If nCnt < nMax Then
 nTot = nTot * nCnt
 nCnt = nCnt + 1
End If
Pascal C/C++
if nCnt < nMax then
 begin
  nTot:=nTot * nCnt;
  nCnt:=nCnt + 1;
 end
if(nCnt < nMax) {
 nTot *= nCnt;
 nCnt++;
 }

See Also

Assignment Statements | Case Sensitivity | CASE Statements | Comments | FOR Loops | Parameter Passing by Reference | Parameter Passing by Value | Variable Declaration | WHILE Loops