IDL

KEYWORD_SET

KEYWORD_SET

The KEYWORD_SET function returns a byte value based on the value of the specified expression. It returns 1 (true) if its argument is defined and nonzero, and 0 (false) otherwise. The exact rules used to determine this are given in Return Value below.

Examples


Suppose that you are writing an IDL procedure that has the following procedure definition line:

PRO myproc, KEYW1 = keyw1, KEYW2 = keyw2

The following command could be used to execute a set of commands only if the keyword KEYW1 is set (i.e., it is present and nonzero):

IF KEYWORD_SET(keyw1) THEN BEGIN

The commands to be executed only if KEYW1 is set would follow.

Syntax


Result = KEYWORD_SET(Expression)

Return Value


This function returns 1 (true) if:

  • Expression is a scalar or 1-element array with a non-zero value.
  • Expression is a structure.
  • Expression is an ASSOC file variable.

KEYWORD_SET returns 0 (false) if:

  • Expression is undefined.
  • Expression is a scalar or 1‑element array with a zero value.

Arguments


Expression

The expression to be tested. Expression is usually a named variable.

Keywords


None.

Version History


Original

Introduced

See Also


ARG_PRESENT, LOGICAL_TRUE, N_ELEMENTS, N_PARAMS

Notes


This page has no user notes yet. Be the first one!


This information is not subject to the controls of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However, it may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
© 2014 Exelis Visual Information Solutions