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

Synopsis

Make sure a feature is present, and load it if not

Syntax

require (String_Type feature [,String_Type file])

Description

The require function ensures that a specified "feature" is present. If the feature is not present, the require function will attempt to load the feature from a file. If called with two arguments, the feature will be loaded from the file specified by the second argument. Otherwise, the feature will be loaded from a file given by the name of the feature, with ".sl" appended.

If, after loading the file, the feature is not present, a warning message will be issued.

NOTES

"feature" is an abstract quantity that is undefined here.

A popular use of the require function is to ensure that a specified file has already been loaded. In this case, the feature is the filename itself. The advantage of using this mechanism over using evalfile is that if the file has already been loaded, require will not re-load it. For this to work, the file must indicate that it provides the feature via the provide function.

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.