Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

Determining if a Keyword is Set


The KEYWORD_SET function returns a 1 (true), if its parameter is defined and nonzero; otherwise, it returns zero (false). For example, assume that a procedure is written which performs and returns the result of a computation. If the keyword PLOT is present and nonzero, the procedure also plots its result as follows:

;Procedure definition. 
PRO XYZ, result, PLOT = plot 
 
;Compute result. 
   ... 
 
;Plot result if keyword parameter is set. 
   IF KEYWORD_SET(PLOT) THEN PLOT, result 
 
END 

A call to this procedure that produces a plot is shown in the following statement.

XYZ, R, /PLOT 

Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]