Skip to the navigation links
Last modified: December 2009

URL: http://cxc-newtest.cfa.harvard.edu/ciao4.2/stackio_stk_count.html
AHELP for CIAO 4.2

stk_count

Context: stackio

Synopsis

Returns the number of elements in a stack.

Syntax

Integer_Type stk_count( Stack_Type stack )

Description

Return the number of entries in a stack.

The stackio module is not available by default; to use it in a S-Lang program, it must be loaded using the S-Lang require() function:

  require("stackio");

Example 1

slsh> require("stackio");
slsh> stk = stk_build( "*.fits" );
slsh> stk_count( stk );
12

Here we have created a stack that contains the 12 files in the current directory that match the pattern

*.fits

Example 2

slsh> stk = stk_build( "@stack.lis" );
slsh> stk_count( stk );
3

In this example there are 3 elements in the file stack.lis.

Bugs

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

See Also

modules
stackio
stackio
stk_append, stk_build, stk_change_current, stk_change_num, stk_close, stk_current, stk_delete_current, stk_delete_num, stk_disp, stk_expand_n, stk_read_next, stk_read_num, stk_rewind, stk_set_current

Last modified: December 2009