(* hubbard.pas - Let's practice writing lines reminiscent of * "Old Mother Hubbard" to illustrate procedure calling. *) program Hubbard; procedure substitute(place, thing, action : string); begin writeln('She went to the ', place); writeln('To buy him ', thing); writeln('But when she came back, '); writeln('He ', action, '.'); writeln(); end; begin writeln('Old Mother Hubbard'); writeln('Went to the cupboard,'); writeln('To give the poor dog a bone;'); writeln('But when she came there'); writeln('The cupboard was bare,'); writeln('And so the poor dog had none.'); writeln(); substitute('alehouse', 'some beer', 'sat in a chair'); substitute('tailor''s', 'a coat', 'was riding a goat'); substitute('hatter''s', 'a hat', 'was feeding her cat'); substitute('barber''s', 'a wig', 'was dancing a jig'); substitute('cobbler''s', 'some shoes', 'was reading the news'); end.