Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
31
Task/String-prepend/SparForte/string-prepend.sparforte
Normal file
31
Task/String-prepend/SparForte/string-prepend.sparforte
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#!/usr/local/bin/spar
|
||||
pragma annotate( summary, "string_prepend" )
|
||||
@( description, "Create a string variable equal to any text value." )
|
||||
@( description, "" )
|
||||
@( description, "Prepend the string variable with another string " )
|
||||
@( description, "literal." )
|
||||
@( category, "tutorials" )
|
||||
@( author, "Ken O. Burtch" )
|
||||
@( see_also, "http://rosettacode.org/wiki/String_prepend" );
|
||||
pragma license( unrestricted );
|
||||
|
||||
pragma software_model( nonstandard );
|
||||
pragma restriction( no_external_commands );
|
||||
|
||||
procedure string_prepend is
|
||||
world : constant string := "World!";
|
||||
hello : constant string := "Hello ";
|
||||
s : string;
|
||||
begin
|
||||
-- Using concatenation
|
||||
s := world;
|
||||
s := hello & @;
|
||||
? s;
|
||||
|
||||
-- Using strings library
|
||||
s := world;
|
||||
s := strings.insert( @, 1, hello );
|
||||
? s;
|
||||
|
||||
command_line.set_exit_status( 0 );
|
||||
end string_prepend;
|
||||
Loading…
Add table
Add a link
Reference in a new issue