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/stackio_stk_read_num.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 stk_read_num Context: stackio

Synopsis

Returns the selected element from a stack.

Syntax

String_Type stk_read_num( Stack_Type stack, Integer_Type N )

Description

Return the character string from a stack in position N. The first item in the stack is assigned the number "1", and sequentially thereafter. NULL is returned if any errors were encountered or if the requested entry was outside the range of the stack.

This function does not change the current position of the stack - i.e. that used by routines like stk_read_next(), stk_set_current(), and stk_rewind().

Example

The following example shows you one way to loop through all the elements in a stack. See the ahelp page for stk_read_next() for another way to do this.

  _for ( 1, stk_count(stk), 1 ) {
    variable i = ();
    variable elem = stk_read_num( stk, i );
    vmessage( "Stack: %s", elem );
  }

Bugs

See the bugs page for the stackio library on the CIAO website for an up-to-date listing of known bugs.

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.