Skip to content

FOR loops

*FOR, index, init_val, end_val, incr
*ENDFOR

Repeats a group of commands a specified number of times

  • *FOR-loops can only be utilized in the user model input file. The command sequence to be processed starts with *FOR and ends with *ENDFOR.
  • *FOR-loops can be nested as shown in the following example.
*FOR,x_sym,1,-1,-2
  *FOR,y_sym,1,-1,-2
    PARA, x_loc=x_sym*(body_x2/2-anchor_s/2);
    STOP,,circ,1,1,,x_loc,y_sym*body_y1/2,x_loc,y_sym*anchor_s/2,4;
  *ENDFOR
*ENDFOR

Input Data⚓︎

Parameter Description
index Loop index
→ Alphanumeric name, has to start with a letter
init_val Initial value of the loop index
→ Real or integer
end_val Ends the loop if index is greater than end_val
→ Real or integer
incr Index increment, can be positive or negative
→ If empty, Increment is set to 1
→ Real or integer (≠0)