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/__get_reference.tm.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 __get_reference Context: slangrtl

Synopsis

Get a reference to a global object

Syntax

Ref_Type __get_reference (String_Type nm)

Description

This function returns a reference to a global variable or function whose name is specified by nm. If no such object exists, it returns NULL, otherwise it returns a reference.

Example

For example, consider the function:

    define runhooks (hook)
    {
       variable f;
       f = __get_reference (hook);
       if (f != NULL)
         @f ();
    }

This function could be called from another S-Lang function to allow customization of that function, e.g., if the function represents a mode, the hook could be called to setup keybindings for the mode.

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.