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

Synopsis

Returns the current position of the stack.

Syntax

Integer_Type stk_current( Stack_Type stack )

Description

This routine returns the current position within a stack. This position determines the element returned by calls to stk_read_next().

When a stack is created, the current position is set to 0 and it is increased by 1 each time stk_read_next() is called. The position can also be changed by the skt_set_current() and stk_rewind() functions.

Example

if ( stk_current(stk) == stk_count(stk) ) stk_rewind(stk);

This code will reset the stack to its start position, by calling stk_rewind(), if it has reached the end of the stack.

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.