-- This program illustrates the use of others in initializing character strings -- It also shows that the Ada predefined type String is an array of characters -- It shows that the elements in the String array can be printed out individually -- It also showed us that put_line doesn't work with characters. -- We saw that we get a warning if we try to print a variable that doesn't have a -- value but the program still compiles and can be run. -- What is printed is junk. with ada.text_io; procedure play_with_others is myString : String (1..10):= ( 'a','b',others => 'c'); yourString : String(3..18); ourString : String (-2..5) := "How silly"; myCharacter : Character ; begin ada.text_io.put_line(myString); yourString := ('d','e', others => 'a'); ada.text_io.put_line (yourString); ada.text_io.put_line (ourString); for i in 1..10 loop ada.text_io.put (myString(i)); end loop; ada.text_io.new_line; ada.text_io.put (myCharacter); end play_with_others;