LOGICAL_TRUE

The LOGICAL_TRUE function returns True (1) if its arguments are non-zero (non-NULL for strings and heap variables), and False (0) otherwise.

Note: For a given argument, the value returned by LOGICAL_TRUE is the opposite of the value returned by the ~ operator.

Example

At the IDL Command Line, enter:

PRINT, LOGICAL_TRUE(2), LOGICAL_TRUE(0)

IDL Prints:

1 0

Syntax

Result = LOGICAL_TRUE(Arg)

Return Value

Integer zero (false) or one (true) if the argument is a scalar, or an array of zeroes and ones if the argument is an array.

Arguments

Arg

The expression on which the logical truth evaluation is to be carried out. The argument can be a scalar or an array of any type other than structure.

Keywords

Thread Pool Keywords

This routine is written to make use of IDL’s thread pool, which can increase execution speed on systems with multiple CPUs. The values stored in the !CPU system variable control whether IDL uses the thread pool for a given computation. In addition, you can use the thread pool keywords TPOOL_MAX_ELTS, TPOOL_MIN_ELTS, and TPOOL_NOTHREAD to override the defaults established by !CPU for a single invocation of this routine. See Appendix D, “Thread Pool Keywords” for details.

Version History

6.0

Introduced

See Also

KEYWORD_SET, LOGICAL_AND, LOGICAL_OR