Scripting 5.3. Jumps

You can use conditional jumps in your script:

if expression
elsif expression
if the expression evaluates to zero or false, the execution of the script jumps to the next elsif or after the next else or endif at the same depth.

The following script computes the preferred length of a bed for a person 'age' years of age:

if age <= 3
   length = 1.20
elsif age <= 8
   length = 1.60
else
   length = 2.00
endif

A variant spelling for elsif is elif.

Links to this page


© ppgb, November 12, 1999