next up previous contents
Next: if elseif else endif Up: GdfidLs command language Previous: Arithmetic expressions   Contents

do-loops

Sections of the inputfile can be interpreted repeatedly via do loops: The structure of a do loop is the same as in Fortran.
  do M1, M2, M3
     # Loop-Body
  enddo
The loop-body may itself contain do-loops, macro calls, whatever. The iteration variable M1 is not restricted to integer values.
  do i= 1, 100, 1   # count upwards
     echo I is i
  enddo
  do i= 100, 1, -1  # count downwards
     echo I is i
  enddo
  do i= 1, 2, 0.1   # non integer step
     echo I is i
     echo 2*I is eval(2*i)
  enddo