| 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.
![[CIAO Logo]](../imgs/ciao_logo_navbar.gif)