Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
20
Task/User-input-Text/SparForte/user-input-text-1.sparforte
Normal file
20
Task/User-input-Text/SparForte/user-input-text-1.sparforte
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/local/bin/spar
|
||||
|
||||
pragma annotate( summary, "get_string" )
|
||||
@( description, "Input a string and the integer 75000 from the text console." )
|
||||
@( see_also, "https://rosettacode.org/wiki/User_input/Text" )
|
||||
@( author, "Ken O. Burtch" );
|
||||
pragma license( unrestricted );
|
||||
|
||||
pragma restriction( no_external_commands );
|
||||
|
||||
procedure get_string is
|
||||
s : unbounded_string;
|
||||
i : integer;
|
||||
begin
|
||||
s := get_line;
|
||||
i := integer( numerics.value( get_line ) );
|
||||
? s @ i;
|
||||
exception when others =>
|
||||
put_line( standard_error, "the value is not valid" );
|
||||
end get_string;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
s := get_line;
|
||||
i := numerics.value( get_line );
|
||||
? s @ i;
|
||||
Loading…
Add table
Add a link
Reference in a new issue