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

Synopsis

The number of parameters passed to a function

Syntax

Integer_Type _NARGS

Description

The value of the _NARGS variable represents the number of arguments passed to the function. This variable is local to each function.

Example

This example uses the _NARGS variable to print the list of values passed to the function:

     define print_values ()
     {
        variable arg;
        
        if (_NARGS == 0)
          {
             message ("Nothing to print");
             return;
          }
        foreach (__pop_args (_NARGS))
          {
             arg = ();
             vmessage ("Argument value is: %S", arg.value);
          }
     }
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.