progn (AutoLISP)

Evaluates each expression sequentially and returns the value of the last expression

Supported Platforms: Windows and Mac OS

Signature

(progn [expr ...])
expr

Type: Integer, Real, String, List, Symbol, File, ads_name, T, or nil

One or more AutoLISP expressions.

Return Values

Type: Integer, Real, String, List, Symbol, File, ads_name, T, or nil

The result of the last evaluated expression.

Remarks

You can use progn to evaluate several expressions where only one expression is expected.

Examples

The if function normally evaluates one then expression if the test expression evaluates to anything but nil. The following example uses progn to evaluate two expressions following if:

(if (= a b)
  (progn
    (princ "\nA = B ")
    (setq a (+ a 10) b (- b 10))
  )
)