About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/__is_initialized.tm.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 __is_initialized Context: slangrtl

Synopsis

Determine whether or not a variable has a value

Syntax

Integer_Type __is_initialized (Ref_Type r)

Description

This function returns non-zero of the object referenced by r is initialized, i.e., whether it has a value. It returns 0 if the referenced object has not been initialized.

Example

For example, the function:

    define zero ()
    {
       variable f;
       return __is_initialized (&f);
    }

will always return zero, but

    define one ()
    {
       variable f = 0;
       return __is_initialized (&f);
    }

will return one.

It is easy to see why a reference to the variable must be passed to __is_initialized and not the variable itself; otherwise, the value of the variable would be passed and the variable may have no value if it was not initialized.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.