Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/local/bin/spar
|
||||
|
||||
pragma annotate( summary, "arrayloop" )
|
||||
@( description, "Loop over multiple arrays simultaneously" )
|
||||
@( category, "tutorials" )
|
||||
@( author, "Ken O. Burtch" )
|
||||
@( see_also, "http://rosettacode.org/wiki/Loop_over_multiple_arrays_simultaneously" );
|
||||
pragma license( unrestricted );
|
||||
|
||||
pragma software_model( nonstandard );
|
||||
pragma restriction( no_external_commands );
|
||||
|
||||
procedure arrayloop is
|
||||
a1 : constant array( 1..3 ) of character := ('a', 'b', 'c');
|
||||
a2 : constant array( 1..3 ) of character := ('A', 'B', 'C');
|
||||
a3 : constant array( 1..3 ) of integer := (1, 2, 3);
|
||||
begin
|
||||
for i in arrays.first( a1 )..arrays.last( a1 ) loop
|
||||
put( a1( i ) )
|
||||
@( a2( i ) )
|
||||
@( strings.trim( strings.image( a3( i ) ), trim_end.both ) );
|
||||
new_line;
|
||||
end loop;
|
||||
end arrayloop;
|
||||
Loading…
Add table
Add a link
Reference in a new issue