|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 2529 (0x9e1)
Types: TextFile
Names: »B«
└─⟦85b835f43⟧ Bits:30000549 8mm tape, Rational 1000, Xlib rev 6.00
└─⟦0c20f784e⟧ »DATA«
└─⟦1abbe589f⟧
└─⟦49e7f20b9⟧
└─⟦this⟧
function Capitalize (Sin : String) return String is
------------------------------------------------------------------------------
-- Sin - Specifies the string to be capitalized
--
-- Capitalize the input string. Each "word" in the string is capitalized.
-- The first letter is upper-case and the rest is lower.
------------------------------------------------------------------------------
Sout : String (Sin'Range);
Sini : Natural := Sin'First;
begin
loop
if Sini > Sin'Last then
return Sout;
end if;
loop
if Sin (Sini) in 'a' .. 'z' then
----Upper-case the first letter in a word.
Sout (Sini) := Character'Val
(Character'Pos (Sin (Sini)) -
(Character'Pos ('a') - Character'Pos ('A')));
Sini := Sini + 1;
exit;
elsif Sin (Sini) in 'A' .. 'Z' or else
Sin (Sini) in '0' .. '9' then
Sout (Sini) := Sin (Sini);
Sini := Sini + 1;
exit;
else
Sout (Sini) := Sin (Sini);
Sini := Sini + 1;
if Sini > Sin'Last then
return Sout;
end if;
end if;
end loop;
if Sini > Sin'Last then
return Sout;
end if;
loop
if Sin (Sini) in 'A' .. 'Z' then
----Lower-case the rest of the word.
Sout (Sini) := Character'Val
(Character'Pos (Sin (Sini)) -
(Character'Pos ('A') - Character'Pos ('a')));
Sini := Sini + 1;
if Sini > Sin'Last then
return Sout;
end if;
elsif Sin (Sini) in 'a' .. 'z' or else
Sin (Sini) in '0' .. '9' then
----Lower-case the rest of the word.
Sout (Sini) := Sin (Sini);
Sini := Sini + 1;
if Sini > Sin'Last then
return Sout;
end if;
else
----New word begins.
Sout (Sini) := Sin (Sini);
Sini := Sini + 1;
exit;
end if;
end loop;
end loop;
end Capitalize;