Skip to content

Instantly share code, notes, and snippets.

@kylelk
Created September 18, 2015 19:26
Show Gist options
  • Save kylelk/4cdcc51accf95b3bbc41 to your computer and use it in GitHub Desktop.
Save kylelk/4cdcc51accf95b3bbc41 to your computer and use it in GitHub Desktop.
with Ada.Text_IO;
use Ada;
procedure name_test is
type Person is record
firstName, lastName : String (1 .. 20);
nameLength : Natural;
end record;
procedure get_person(person_info: out Person) is
begin
Text_IO.Put("first name: ");
Text_IO.Get_line(person_info.firstName, person_info.nameLength);
Text_IO.Put("last name: ");
Text_IO.Get_line(person_info.lastName, person_info.nameLength);
end get_person;
procedure display_person(person_info: in Person) is
begin
Text_IO.Put("first name: ");
Text_IO.Put_Line(person_info.firstName);
Text_IO.Put("last name: ");
Text_IO.Put_Line(person_info.lastName);
end display_person;
new_member : Person;
begin
get_person(new_member);
display_person(new_member);
end name_test;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment