-- $Source: /commtar/monoBANK/CICS_INTF/io_c_3.ada,v $ -- $Revision: 1.1 $ $Date: 88/03/26 18:56:09 $ $Author: chris $ with CICS_test_reporter; use CICS_test_reporter; with CICS_exceptions; use CICS_exceptions; with text_io; use text_io; ---------------- procedure io_c_3 ---------------- is type line_array is array (integer range <>) of string(1..60); line : constant line_array (0..3) := ( "123456789+123456789+123456789+123456789+123456789+123456789+", "Personal workstations have emerged as an important computing", "resource in the 1980s. Workstations are now used for appli- ", "cations such as design automation, text processing, etc. "); a_line : string(1..100); a_page : string(1..2000); k : integer; ---------------------------- procedure Start_text_io_test( ---------------------------- Id : string; Msg : string) is begin Start_test(Id, Msg); Put_line(Id & " " & Msg); New_line; New_line; end; -------------------------- procedure End_text_io_test -------------------------- is begin New_page; End_interactive_test; end; begin Start_interactive_module("io_c_3", "Text_io"); Start_text_io_test("io_c_3_a", "put a character on a line via put"); Put ("X"); End_text_io_test; Start_text_io_test("io_c_3_b", "put a character in the 30th column via " & "set_col"); Put_line( Line(0) ); Set_col(30); Put ("X"); End_text_io_test; Start_text_io_test("io_c_3_c", "put 2 lines of 60 characters via put " & "a character and new_line"); for j in 1..2 loop for i in 1..60 loop Put ("X"); end loop; New_line; end loop; End_text_io_test; Start_text_io_test("io_c_3_d", "display 3 line via put_lines"); for i in 1..3 loop Put_line( Line(i) ); end loop; End_text_io_test; Start_text_io_test("io_c_3_e", "display 3 lines via put and new_line"); for i in 1..3 loop Put( Line(i) ); New_line; end loop; End_text_io_test; Start_text_io_test("io_c_3_f", "put a line on the 1st, 3rd, and 5th " & "lines via set_line"); Set_line(1); put_line( Line(1) ); Set_line(3); put_line( Line(2) ); Set_line(5); put_line( Line(3) ); End_text_io_test; Start_text_io_test("io_c_3_g", "display 3 line on separate pages " & "via new_page"); for i in 1..3 loop Put_line( Line(i) ); New_page; end loop; End_text_io_test; Start_text_io_test("io_c_3_h", "Enter 1 line of text. Echo line via get"); for i in 1..100 loop if End_of_line then exit; end if; Get(a_line(i..i)); K := i; end loop; for i in 1..K loop Put(a_line(i..i)); end loop; End_text_io_test; Start_text_io_test("io_c_3_i", "Enter 1 line of text. Echo line via " & "get_line"); Get_Line(a_line, K); Put_line(a_line(1..K)); End_text_io_test; End_interactive_module; exception when Others => unexpected_exception("undocumented exception"); End_module; end;