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

Synopsis

Get the value associated with a structure field

Syntax

x = get_struct_field (Struct_Type s, String field_name)

Description

The get_struct_field function gets the value of the field whose name is specified by field_name of the structure s.

Example

The following example illustrates how this function may be used to to print the value of a structure.

      define print_struct (s)
      {
         variable name;

         foreach (get_struct_field_names (s))
           {
             name = ();
             value = get_struct_field (s, name);
             vmessage ("s.%s = %s\n", name, string(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.