Skip to the navigation links
Last modified: December 2009

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

stk_expand_n

Context: stackio

Synopsis

Create a numbered stack of N elements.

Syntax

Stack_Type stk_expand_n( String_Type stackstring, Integer_Type N )

Description

This routine creates a stack of N elements where each element is consecutively numbered from 1 to N. The stackstring argument should contain the "#" character, which will be replaced by the number 1, 2, 3, ..., N. These numbers will be padded by leading "0" characters to ensure that each string in the stack has the same length.

Note that only the first # character in stackstring will be expanded.

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

slsh> require("stackio");
slsh> stk = stk_expand_n( "spec#.pi", 11 );
slsh> stk_disp( stk );
------
Stack position: 0
Stack size: 11
Stack allocated: 11
Stack entries:
1 :spec01.pi:
2 :spec02.pi:
3 :spec03.pi:
4 :spec04.pi:
5 :spec05.pi:
6 :spec06.pi:
7 :spec07.pi:
8 :spec08.pi:
9 :spec09.pi:
10 :spec10.pi:
11 :spec11.pi:
------

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_count, stk_current, stk_delete_current, stk_delete_num, stk_disp, stk_read_next, stk_read_num, stk_rewind, stk_set_current

Last modified: December 2009