For For[beg, cond, incr, expr] runs a for loop. Attributes[For] := {HoldAll, Protected} Simple examples In[1]:= CompoundExpression[For[n = 1, (n) < (1000), Increment[n], If[PrimeQ[n] && ((n) > (7)), Return[]]], n] Out[1]= 11