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

Synopsis

Set automatic variable declaration mode

Syntax

Integer_Type _auto_declare

Description

The _auto_declare may be used to have all undefined variables implicitely declared as static. If set to zero, any variable must be declared with a variable declaration before it can be used. If set to one, then any undeclared variabled will be declared as a static global variable.

The _auto_declare variable is local to each compilation unit and setting its value in one unit has no effect upon its value in other units. The value of this variable has no effect upon the variables in a function.

Example

The following code will not compile if X not been declared:

    X = 1;

However,

    _auto_declare = 1;   % declare variables as static.
    X = 1;

is equivalent to

    static variable X = 1;

NOTES

This variable should be used sparingly and is intended primarily for interactive applications where one types S-Lang commands at a prompt.

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.