The syntax is listed in the ngspice manual, chapter 17.6 Control Structures. Practical examples using a simple voltage divider circuit are given here.