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

Synopsis

Returns the next element from a stack.

Syntax

String_Type stk_read_next( Stack_Type stack )

Description

This routine returns the next element in the stack and increases the current position by 1. If the end of the stack is reached - so that the value returned by stk_current() equals that returned by stk_count() then the pointer is not advanced and NULL is returned.

The stk_read_num() routine provides a means to read the the stack contents without changing the current position of the stack.

Example

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

  stk_rewind( stk );
  loop ( stk_count(stk) ) {
    variable elem = stk_read_next( stk );
    vmessage( "Stack: %s", elem );
  }

CHANGES IN CIAO 3.2

The function now returns NULL when called at the end of a stack rather than causing an "Intrinsic Error".

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.