home *** CD-ROM | disk | FTP | other *** search
/ Programmer's ROM - The Computer Language Library / programmersrom.iso / ada / virterm / vt2.tst < prev    next >
Encoding:
Text File  |  1988-05-03  |  61.9 KB  |  1,763 lines

  1. ::::::::::
  2. vt_tst.dis
  3. ::::::::::
  4. --
  5. -- Test files
  6. --
  7. screen_test4.ada
  8. vt_test.ada
  9. ::::::::::
  10. screen_test4.ada
  11. ::::::::::
  12. WITH
  13.     text_io,
  14.     page_terminal;
  15.  
  16. PROCEDURE screen_test4 IS
  17.  
  18.     PACKAGE vt RENAMES page_terminal;
  19.  
  20.     input_buffer : string( 1..80 );
  21.     input_buffer_length : natural;
  22.     keys : vt.function_key_descriptor( 4 );
  23.     dimensions : vt.xy_position;
  24.  
  25.     terminal_name : string( 1..4 ) := "none";
  26.  
  27. BEGIN -- page_test2
  28.  
  29. -- ----------------------
  30.     vt.open( terminal_name );
  31.     dimensions := vt.size;
  32.     vt.erase_in_display( vt.all_positions );
  33. -- ----------------------
  34.     vt.set_position( vt.xy_position'( 1,1 ) );
  35.     vt.get( input_buffer, input_buffer_length, keys );
  36.  
  37. -- ----------------------
  38.     vt.erase_in_display( vt.all_positions );
  39.  
  40.     FOR i IN 1..dimensions.line
  41.     LOOP
  42.         vt.set_position( vt.xy_position'( i, 1 ) );
  43.         vt.put( string'( 1..10 => '#' ) );
  44.         vt.select_graphic_rendition( vt.reverse_image );
  45.         vt.put(positive'image(i));
  46.         vt.select_graphic_rendition( vt.primary_rendition );
  47.     END LOOP;
  48.     vt.update_screen( 1,dimensions.line );
  49.     vt.get( input_buffer, input_buffer_length, keys );
  50.  
  51. -- ---------------------
  52.     vt.set_position( vt.xy_position'( 2,1 ) );
  53.     vt.delete_line( 22);
  54.     vt.set_position(vt.xy_position'(2,1));
  55.     vt.insert_line(22);
  56. --  vt.update_screen(1,dimensions.line);
  57. --  vt.get(input_buffer, input_buffer_length, keys);
  58. -- ---------------------
  59.  
  60.     FOR I IN 1..dimensions.line
  61.      LOOP
  62.          vt.set_position(vt.xy_position'(i,1));
  63.          vt.put(string'(1..10 => '?' ));
  64.          vt.put(string'(25..27 => 'b' ));
  65.      END LOOP;
  66.     vt.update_screen( 1,dimensions.line );
  67.     vt.get( input_buffer, input_buffer_length, keys );
  68. -- ---------------------
  69.     vt.set_position(vt.xy_position'(3,1));
  70.     vt.insert_line(1);
  71.     vt.update_screen(3,24);
  72.     vt.get(input_buffer, input_buffer_length, keys);
  73. -- --------------------
  74.     vt.set_position(vt.xy_position'(1,1));
  75.     vt.insert_line(2);
  76.     vt.update_screen(1,24);
  77.     vt.get(input_buffer,input_buffer_length, keys);
  78. -- --------------------
  79.     vt.set_position(vt.xy_position'(23,13));
  80.     vt.delete_line(5);
  81.     vt.set_position(vt.xy_position'(24,45));
  82.     vt.put("STRIKE ANY KEY");
  83.     vt.update_screen(1,dimensions.line);
  84.     vt.get(input_buffer,input_buffer_length,keys);
  85. -- --------------------
  86.     vt.set_position( vt.xy_position'(1,1));
  87.     vt.insert_line(1);
  88.     vt.update_screen(1,dimensions.line);
  89. -- ---------------------
  90.     vt.set_position(vt.xy_position'(1,1));
  91.     vt.delete_line(1);
  92.     vt.update_screen(1,dimensions.line);
  93.     vt.get(input_buffer, input_buffer_length,keys);
  94. -- --------------------
  95.     vt.set_position( vt.xy_position'( 2,5 ) );
  96.     vt.erase_in_line( vt.from_xy_position_to_end );
  97.     vt.update_screen( 5,6 );
  98.     vt.get( input_buffer, input_buffer_length, keys );
  99. -- --------------------
  100.     vt.set_position( vt.xy_position'( 5,1 ) );
  101.     vt.enter_insert_mode;
  102.     vt.select_graphic_rendition( vt.reverse_image );
  103.     vt.put( "------------------------------->" );
  104.     vt.select_graphic_rendition( vt.primary_rendition );
  105.     vt.update_screen( 5,10 );
  106.     vt.get( input_buffer, input_buffer_length, keys );
  107. -- --------------------
  108.     vt.set_position( vt.xy_position'( 2,1 ) );
  109.     vt.put("hi there");
  110.     vt.update_screen( 2,2 );
  111.     vt.get( input_buffer, input_buffer_length, keys );
  112. -- --------------------
  113.     vt.set_position(vt.xy_position'(24,24));
  114.     vt.put( "**************************");
  115.     vt.update_screen(1,dimensions.line);
  116. -- --------------------
  117.     vt.get( input_buffer, input_buffer_length, keys );
  118.  
  119.     vt.set_position(vt.xy_position'(3,1));
  120.     vt.delete_line(4);
  121.     vt.update_screen(1, 10 );
  122. --  vt.update_screen(1,dimensions.line);
  123. -- --------------------
  124.     vt.set_position( vt.xy_position'( 24,1 ) );
  125.     vt.put( "This is a test of the Virtual terminal line 24 ********" );
  126.     vt.update_screen( 20,24 );
  127. --
  128.     vt.set_position( vt.xy_position'( 2,1 ) );
  129.     vt.delete_line( 22);
  130.     vt.set_position(vt.xy_position'(2,1));
  131.     vt.insert_line(22);
  132. -- ---------------------
  133.     vt.select_graphic_rendition( vt.reverse_image );
  134.     FOR I IN 5..10
  135.      LOOP
  136.          vt.set_position(vt.xy_position'(i,1));
  137.          vt.put( "test test test test test test test test test test " );
  138.      END LOOP;
  139.     vt.update_screen( 1,dimensions.line );
  140.     vt.select_graphic_rendition( vt.primary_rendition );
  141.     vt.get( input_buffer, input_buffer_length, keys );
  142.  
  143.     vt.close;
  144.  
  145. END screen_test4;
  146. PRAGMA main;
  147. ::::::::::
  148. vt_test.ada
  149. ::::::::::
  150. --
  151. --
  152. -- Abstract:    The following test file contains the Acceptance Test
  153. --              Procedures for the NOSC Virtual Terminal.  The testing
  154. --              is divided logically into 3 sections, the first is the
  155. --              page terminal section followed by the scroll terminal
  156. --              and finally the form terminal.
  157. --
  158. --
  159. --
  160. --
  161. --
  162. -- testing set tab procedures
  163. --
  164. --
  165. --
  166. with
  167.      text_io,
  168.      vt_content,
  169.      driver,
  170.      vt_input,
  171.      scroll_terminal,
  172.      form_terminal,
  173.      PAGE_TERMINAL ;
  174.  
  175. procedure  vt_test IS
  176.  
  177.  
  178.   package st renames scroll_terminal ;
  179.   package VT renames PAGE_TERMINAL ;
  180.   package form renames form_terminal ;
  181.   PACKAGE int_io IS NEW text_io.integer_io(form.termination_key_range) ;
  182.  
  183.   TERMINAL_NAME : string( 1..4 ) := "none";
  184.   IN_BUFFER     : string( 1..80) ;
  185.   IN_BUFFER_LEN : natural ;
  186.   data : string(1..5) ;
  187.   last : natural  ;
  188.   keys : vt.function_key_descriptor(32) ;
  189.   keys2: st.function_key_descriptor(32) ;
  190.   key_last : natural ;
  191.   key_name : string(1..11) ;
  192.   prev_pos : natural ;
  193.   key_id2: vt.function_key_enum ;
  194.   key_id : st.function_key_enum ;
  195.   last_position : natural ;
  196.   num_function_keys : natural ;
  197.   left_arrow : string(1..1) := string'( 1 => '<' ) ;
  198.   right_arrow: string(1..1) := string'( 1 => '>' ) ;
  199.   value : form.termination_key_range ;
  200.   buffer: string(1..10) ;
  201.  
  202.  
  203. PROCEDURE create_form1 IS
  204. BEGIN
  205.  
  206.    form.set_position( form.xy_position'(  3, 10) );
  207.    form.define_qualified_area( intensity => form.high,
  208.                              protection => form.unprotected,
  209.                              input => form.graphic_characters );
  210.  
  211.    form.set_position( form.xy_position'(  3,51 ) );
  212.    form.define_qualified_area( intensity => form.normal,
  213.                              protection => form.protected );
  214.  
  215.    form.set_position( form.xy_position'(  5,10 ) );
  216.    form.define_qualified_area( intensity => form.high,
  217.                              protection => form.unprotected,
  218.                              input => form.graphic_characters );
  219.  
  220.    form.set_position( form.xy_position'(  5,51 ) );
  221.    form.define_qualified_area( intensity => form.normal,
  222.                              protection => form.protected );
  223.  
  224.    form.set_position( form.xy_position'(  7, 7 ) );
  225.    form.define_qualified_area( intensity => form.high,
  226.                              protection => form.unprotected,
  227.                              input => form.graphic_characters );
  228.  
  229.    form.set_position( form.xy_position'(  7,28 ) );
  230.    form.define_qualified_area( intensity => form.normal,
  231.                              protection => form.protected );
  232.  
  233.    form.set_position( form.xy_position'(  7,37 ) );
  234.    form.define_qualified_area( intensity => form.high,
  235.                              protection => form.unprotected,
  236.                              input => form.graphic_characters );
  237.  
  238.    form.set_position( form.xy_position'(  7,40 ) );
  239.    form.define_qualified_area( intensity => form.normal,
  240.                              protection => form.protected );
  241.  
  242.    form.set_position( form.xy_position'(  7,46 ) );
  243.    form.define_qualified_area( intensity => form.high,
  244.                              protection => form.unprotected,
  245.                              input => form.numerics );
  246.  
  247.    form.set_position( form.xy_position'(  7,54 ) );
  248.    form.define_qualified_area( intensity => form.normal,
  249.                              protection => form.protected );
  250.  
  251.    form.set_position( form.xy_position'( 11, 1 ) );
  252.    form.define_qualified_area( intensity => form.high,
  253.                              protection => form.unprotected,
  254.                              input => form.graphic_characters );
  255.  
  256.    form.set_position( form.xy_position'( 11,62 ) );
  257.    form.define_qualified_area( intensity => form.normal,
  258.                              protection => form.protected );
  259.  
  260.    form.set_position( form.xy_position'( 12, 1 ) );
  261.    form.define_qualified_area( intensity => form.high,
  262.                              protection => form.unprotected,
  263.                              input => form.graphic_characters );
  264.  
  265.    form.set_position( form.xy_position'( 12,62 ) );
  266.    form.define_qualified_area( intensity => form.normal,
  267.                              protection => form.protected );
  268.  
  269.    form.set_position( form.xy_position'( 13, 1 ) );
  270.    form.define_qualified_area( intensity => form.high,
  271.                              protection => form.unprotected,
  272.                              input => form.graphic_characters );
  273.  
  274.    form.set_position( form.xy_position'( 13, 62) );
  275.    form.define_qualified_area( intensity => form.normal,
  276.                              protection => form.protected );
  277.  
  278.    form.set_position( form.xy_position'( 14, 1 ) );
  279.    form.define_qualified_area( intensity => form.high,
  280.                              protection => form.unprotected,
  281.                              input => form.graphic_characters );
  282.  
  283.    form.set_position( form.xy_position'( 14,62 ) );
  284.    form.define_qualified_area( intensity => form.normal,
  285.                              protection => form.protected );
  286.  
  287.    form.set_position( form.xy_position'( 42,100) );  --just a test!
  288.    form.define_qualified_area( intensity => form.normal,
  289.                              protection => form.protected );
  290.  
  291.    form.set_position( form.xy_position'(  3,  1 ) );
  292.    form.put( "NAME    :" );
  293.  
  294.    form.set_position( form.xy_position'(  5,  1 ) );
  295.    form.put( "ADDRESS :" );
  296.  
  297.    form.set_position( form.xy_position'(  7,  1 ) );
  298.    form.put( "CITY :" );
  299.  
  300.    form.set_position( form.xy_position'(  7, 30 ) );
  301.    form.put( "STATE :" );
  302.  
  303.    form.set_position( form.xy_position'(  7, 41 ) );
  304.    form.put( "ZIP :" );
  305.  
  306.    form.set_position( form.xy_position'( 10,  1 ) );
  307.    form.put( "DESCRIPTION:" );
  308.  
  309.    form.set_position( form.xy_position'(17,1 ) ) ;
  310.    form.put("Enter any data you wish in this present form.  Data entered");
  311.    form.set_position( form.xy_position'(18,1 ) ) ;
  312.    form.put("in protected areas or areas where that type of input is not") ;
  313.    form.set_position( form.xy_position'(19,1 ) ) ;
  314.    form.put("allowed( such as letters in a numeric field ) will cause the ") ;
  315.    form.set_position( form.xy_position'(20,1 ) ) ;
  316.    form.put("bell to ring.  You, the user, will have to test the local") ;
  317.    form.set_position( form.xy_position'(21,1 ) ) ;
  318.    form.put("editing functions while the form is active. The local editing ") ;
  319.    form.set_position( form.xy_position'(22,1 ) ) ;
  320.    form.put("functions include:  arrow keys, carraige return, delete key, and");
  321.    form.set_position( form.xy_position'(23,1 ) ) ;
  322.    form.put("the tab key.  Strike a function key when finished....") ;
  323.  
  324. END create_form1 ;
  325.  
  326. PROCEDURE modify_form1 IS
  327.  
  328. BEGIN
  329.    form.set_position( form.xy_position'(3,10) ) ;
  330.    form.erase_area ;
  331.    form.tab; form.tab ;
  332.    form.erase_area ;
  333.    form.tab; form.tab ;
  334.    form.erase_area ;
  335.    form.tab; form.tab ;
  336.    form.erase_area ;
  337.    form.tab; form.tab ;
  338.    form.erase_area ;
  339.    form.tab ;
  340.    form.erase_area ;
  341.    form.tab ; form.erase_area ;
  342.    form.clear_qualified_area ;
  343.    form.tab; form.clear_qualified_area ;
  344.    form.tab ;
  345.    form.erase_area ;
  346.    form.clear_qualified_area ;
  347.    form.tab;  form.clear_qualified_area ;  form.tab ;
  348.    form.erase_area ;
  349.    form.clear_qualified_area ;
  350.    form.tab;  form.clear_qualified_area ;   form.tab ;
  351.    form.erase_area ;
  352.    form.clear_qualified_area ;
  353.    form.set_position( form.xy_position'(17,5) ) ;
  354.    form.erase_area ;
  355.  
  356.    form.set_position( form.xy_position'(12, 1) ) ;
  357.    form.put("The previous form was modified using the tab, erase area, and") ;
  358.    form.set_position( form.xy_position'(13, 1) ) ;
  359.    form.put("clear area functionalities of the form terminal.") ;
  360.    form.set_position( form.xy_position'(15, 1) ) ;
  361.    form.put("Strike a function key to continue...") ;
  362.  
  363.    form.set_position( form.xy_position'( 14, 20 ) ) ;
  364.    form.tab ; form.clear_qualified_area ;
  365.  
  366. END  modify_form1 ;
  367.  
  368. PROCEDURE create_form2 IS
  369.  
  370. BEGIN
  371.    form.set_position( form.xy_position'( 12, 5 ) );
  372.    form.erase_area ;
  373.  
  374.    form.set_position( form.xy_position'(  9, 6 ) );
  375.    form.define_qualified_area( intensity => form.high,
  376.                              protection => form.unprotected,
  377.                              input => form.graphic_characters );
  378.  
  379.    form.set_position( form.xy_position'(  9,15 ) );
  380.    form.define_qualified_area( intensity => form.normal,
  381.                              protection => form.protected );
  382.  
  383.    form.set_position( form.xy_position'( 9 ,25 ) );
  384.    form.define_qualified_area( intensity => form.high,
  385.                              protection => form.unprotected,
  386.                              input => form.graphic_characters );
  387.  
  388.    form.set_position( form.xy_position'(  9,27 ) );
  389.    form.define_qualified_area( intensity => form.normal,
  390.                              protection => form.protected );
  391.  
  392.    form.set_position( form.xy_position'(  9,35 ) );
  393.    form.define_qualified_area( intensity => form.high,
  394.                              protection => form.unprotected,
  395.                              input => form.graphic_characters );
  396.  
  397.    form.set_position( form.xy_position'(  9,46 ) );
  398.    form.define_qualified_area( intensity => form.normal,
  399.                              protection => form.protected );
  400.  
  401.    form.set_position( form.xy_position'( 11,16 ) );
  402.    form.define_qualified_area( intensity => form.high,
  403.                              protection => form.unprotected,
  404.                              input => form.graphic_characters );
  405.  
  406.    form.set_position( form.xy_position'( 16,1  ) );
  407.    form.define_qualified_area( intensity => form.normal,
  408.                              protection => form.protected );
  409.  
  410.    form.set_position( form.xy_position'( 17,19 ) );
  411.    form.define_qualified_area( intensity => form.high,
  412.                              protection => form.unprotected,
  413.                              input => form.graphic_characters ) ;
  414.  
  415.    form.set_position( form.xy_position'( 20, 1 ) );
  416.    form.define_qualified_area( intensity => form.normal,
  417.                              protection => form.protected );
  418.  
  419.  
  420.    form.set_position( form.xy_position'( 9, 1)  ) ;
  421.    form.put("DATE:") ;
  422.  
  423.    form.set_position( form.xy_position'( 9,21)  ) ;
  424.    form.put("SEX:") ;
  425.  
  426.    form.set_position( form.xy_position'( 9,30)  ) ;
  427.    form.put("RACE:") ;
  428.  
  429.    form.set_position( form.xy_position'(11, 1)  ) ;
  430.    form.put("JOB EXPERIENCE:") ;
  431.  
  432.    form.set_position( form.xy_position'(17, 1)  ) ;
  433.    form.put("INTERESTS/HOBBIES:") ;
  434.  
  435.    form.set_position( form.xy_position'( 22, 10 ) ) ;
  436.    form.put("Again, test the local editing as you wish.");
  437.  
  438.    form.set_position( form.xy_position'( 23, 5 ) ) ;
  439.    form.put("Strike a function key to exit the test of the virtual terminal!");
  440.  
  441. END create_form2 ;
  442.  
  443. -- start of body for all the tests
  444. --
  445. --
  446.  
  447. begin
  448.   VT.OPEN ;
  449. --
  450. -- This Ada program produces the introduction for the complete
  451. --  testing to be done by the user.
  452. --
  453.  
  454.   VT.SET_POSITION( VT.XY_POSITION'(12, 18) ) ;
  455.   VT.SELECT_GRAPHIC_RENDITION( VT.REVERSE_IMAGE ) ;
  456.  
  457.   VT.PUT("  INTERACTIVE TEST OF THE VIRTUAL TERMINAL  ") ;
  458.   VT.SET_POSITION( VT.XY_POSITION'(24, 50) ) ;
  459.   VT.SELECT_GRAPHIC_RENDITION( VT.PRIMARY_RENDITION ) ;
  460.  
  461.   VT.PUT("...strike any key to continue." ) ;
  462.   vt.update_screen(1, vt_content.height ) ;
  463.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  464.   vt.erase_in_display( vt.all_positions ) ;
  465.   vt.update_screen(1, vt_content.height ) ;
  466.  
  467. --
  468. --
  469. -- Abstract :   The first section of this test file will fully test the
  470. --              functionalities of the page terminal, as stated in the
  471. --              Requirements Specification Document.
  472. --
  473. --              The person performing these tests can refer back to the
  474. --              Specification document to verify the correctness of each test.
  475. --
  476.  
  477.  
  478. --
  479. -- This Ada program produces the introduction for the page_mode
  480. -- testing to be done by the user.
  481. --
  482.  
  483.   VT.SET_POSITION( VT.XY_POSITION'(10, 18) ) ;
  484.   VT.SELECT_GRAPHIC_RENDITION( VT.REVERSE_IMAGE ) ;
  485.  
  486.   VT.PUT("  INTERACTIVE TEST FOR THE PAGE MODE TERMINAL  ") ;
  487.   VT.SET_POSITION( VT.XY_POSITION'(12, 28) ) ;
  488.   VT.PUT("  OF THE VIRTUAL TERMINAL  ") ;
  489.  
  490.   VT.SET_POSITION( VT.XY_POSITION'(24, 50) ) ;
  491.   VT.SELECT_GRAPHIC_RENDITION( VT.PRIMARY_RENDITION ) ;
  492.  
  493.   VT.PUT("...strike any key to continue." ) ;
  494.   vt.update_screen(1, vt_content.height) ;
  495.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  496.   vt.erase_in_display( vt.all_positions ) ;
  497.   vt.update_screen( 1, vt_content.height ) ;
  498.  
  499.   VT.SET_POSITION( VT.XY_POSITION'(5, 20) ) ;
  500.   VT.PUT("Tests for set_tab and move by tabs for ") ;
  501.   VT.SET_POSITION( VT.XY_POSITION'(6, 15) ) ;
  502.   VT.PUT("the page_mode terminal, refer to sections 3.3.3.9") ;
  503.   VT.SET_POSITION( VT.XY_POSITION'(7, 15) ) ;
  504.   VT.PUT("and 3.3.3.11 of the test document.") ;
  505.   VT.SET_POSITION( VT.XY_POSITION'(24, 45) ) ;
  506.   VT.PUT("...strike any key to continue.") ;
  507.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  508.  
  509.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  510.   VT.ERASE_IN_DISPLAY( VT.ALL_POSITIONS ) ;
  511.   VT.SET_POSITION( VT.XY_POSITION'(1, 1) ) ;
  512.  
  513.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  514.  
  515.   VT.SET_POSITION( VT.XY_POSITION'(5, 15) ) ;
  516.   VT.SET_TAB ;
  517.  
  518.   VT.SET_POSITION( VT.XY_POSITION'(1, 25) ) ;
  519.   VT.SET_TAB ;
  520.   VT.SET_POSITION( VT.XY_POSITION'(1, 1) ) ;
  521.   VT.PUT("123456789012345678901234567890123456789012345678901234567890") ;
  522.   VT.SET_POSITION( VT.XY_POSITION'(5, 40) ) ;
  523.   VT.PUT("Tabs have been set in columns 15 and 25.") ;
  524.   VT.SET_POSITION( VT.XY_POSITION'(6, 32) ) ;
  525.   VT.PUT("We will tab over to those spots and print a 'C'.") ;
  526.   VT.SET_POSITION( VT.XY_POSITION'(7, 32) ) ;
  527.   VT.PUT("Strike a key when ready...") ;
  528.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  529.  
  530.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  531.  
  532.   VT.SET_POSITION( VT.XY_POSITION'(10, 1) ) ;
  533.   VT.TAB ;
  534.   VT.PUT('C') ;
  535.   VT.TAB ;
  536.   VT.PUT('C') ;
  537.   VT.UPDATE_SCREEN( 10, 10 ) ;
  538.  
  539.   VT.SET_POSITION( VT.XY_POSITION'(24, 50) ) ;
  540.   VT.PUT("..strike any key to continue.") ;
  541.   VT.UPDATE_SCREEN( 24, 24 ) ;
  542.  
  543.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  544.  
  545.  
  546.   VT.erase_in_display( vt.all_positions ) ;
  547. --
  548. -- testing clear tab and set tab procedures
  549. --
  550. --
  551. --
  552.  
  553.   VT.SET_POSITION( VT.XY_POSITION'(5, 20) ) ;
  554.   VT.PUT("Tests for clear_tab and set tabs for ") ;
  555.   VT.SET_POSITION( VT.XY_POSITION'(6, 15) ) ;
  556.   VT.PUT("the page_mode terminal, refer to sections 3.3.3.9") ;
  557.   VT.SET_POSITION( VT.XY_POSITION'(7, 15) ) ;
  558.   VT.PUT("and 3.3.3.10 of the Test Procedures document.") ;
  559.   VT.SET_POSITION( VT.XY_POSITION'(24, 45) ) ;
  560.   VT.PUT("...strike any key to continue.") ;
  561.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  562.  
  563.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  564.   VT.ERASE_IN_DISPLAY( VT.ALL_POSITIONS ) ;
  565.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  566.  
  567.  
  568.   VT.SET_POSITION( VT.XY_POSITION'(1, 1) ) ;
  569.  
  570.   VT.SET_POSITION( VT.XY_POSITION'(5, 15) ) ;
  571.   VT.SET_TAB ;
  572.  
  573.   VT.SET_POSITION( VT.XY_POSITION'(1, 25) ) ;
  574.   VT.SET_TAB ;
  575.  
  576.   VT.SET_POSITION( VT.XY_POSITION'(1, 1) ) ;
  577.   VT.PUT("123456789012345678901234567890123456789012345678901234567890") ;
  578.   VT.SET_POSITION( VT.XY_POSITION'(5, 35) ) ;
  579.   VT.PUT("Tabs have been set in columns 15 and 25.") ;
  580.   VT.SET_POSITION( VT.XY_POSITION'(6, 30) ) ;
  581.   VT.PUT("The 'C's denote these spots.") ;
  582.   VT.SET_POSITION( VT.XY_POSITION'(8, 30) ) ;
  583.  
  584.   VT.PUT("Strike a key when ready...") ;
  585.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  586.  
  587.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  588. -- ----------------------------------------------
  589.   VT.SET_POSITION( VT.XY_POSITION'(10, 1) ) ;
  590.   VT.TAB ;
  591.   VT.PUT('C') ;
  592.  
  593.   VT.TAB ;
  594.   VT.PUT('C') ;
  595.   VT.UPDATE_SCREEN( 10, 10 ) ;
  596.  
  597.   VT.SET_POSITION( VT.XY_POSITION'(12, 35) ) ;
  598.   VT.PUT("We will now tab over to the first tab stop,") ;
  599.   VT.SET_POSITION( VT.XY_POSITION'(13, 30) ) ;
  600.   VT.PUT("clear it, and position the cursor in column 1.") ;
  601.  
  602.   VT.SET_POSITION( VT.XY_POSITION'(16, 1) ) ;
  603.   VT.TAB ;
  604.   VT.CLEAR_TAB ;
  605.  
  606.   VT.SET_POSITION( VT.XY_POSITION'(19, 30) ) ;
  607.   VT.PUT("We will now tab to the first tab stop on the") ;
  608.   VT.SET_POSITION( VT.XY_POSITION'(20, 25) ) ;
  609.   VT.PUT("line and print a 'C', it should be in column") ;
  610.   VT.SET_POSITION( VT.XY_POSITION'(21, 25) ) ;
  611.   VT.PUT("25.  Stike a key to show the result.") ;
  612.  
  613.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  614.  
  615.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  616.  
  617.   VT.SET_POSITION( VT.XY_POSITION'(16, 1) ) ;
  618.   VT.TAB ;
  619.   VT.PUT('C') ;
  620.   VT.UPDATE_SCREEN( 16, 16 ) ;
  621.  
  622.  
  623.   VT.SET_POSITION( VT.XY_POSITION'(24,50) ) ;
  624.   VT.PUT("..strike any key to continue.");
  625.   VT.UPDATE_SCREEN( 24, 24 ) ;
  626.  
  627.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  628.  
  629.  
  630.   VT.erase_in_display( vt.all_positions ) ;
  631.   vt.update_screen( 1, vt_content.height ) ;
  632. --
  633. -- testing moving by tab stops, inserting new lines
  634. -- on the display, and moving to a new page
  635. --
  636. --
  637.   VT.SET_POSITION( VT.XY_POSITION'(5, 20) ) ;
  638.   VT.PUT("Tests for move by tabs, insert_line and moving") ;
  639.   VT.SET_POSITION( VT.XY_POSITION'(6, 12) ) ;
  640.   VT.PUT("to a new page, refer to sections 3.3.3.12, 3.3.3.22") ;
  641.   VT.SET_POSITION( VT.XY_POSITION'(7, 12) ) ;
  642.   VT.PUT("and 3.3.3.13 of the Test Procedures document.") ;
  643.   VT.SET_POSITION( VT.XY_POSITION'(10, 20) ) ;
  644.   VT.PUT("Erase_in_display will also be tested here,") ;
  645.   VT.SET_POSITION( VT.XY_POSITION'(11, 12) ) ;
  646.   VT.PUT("refer to section 3.3.3.19 of the document.") ;
  647.  
  648.   VT.SET_POSITION( VT.XY_POSITION'(24, 45) ) ;
  649.   VT.PUT("...strike any key to continue.") ;
  650.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  651.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  652.  
  653.   VT.ERASE_IN_DISPLAY( VT.ALL_POSITIONS ) ;
  654.   VT.SET_POSITION( VT.XY_POSITION'(1, 1) ) ;
  655.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  656.  
  657.  
  658.   VT.PUT("There are no tab stops set on the display, so a call on") ;
  659.   VT.SET_POSITION( VT.XY_POSITION'(2, 1) ) ;
  660.   VT.PUT("TAB should produce no operation. Let's try it.") ;
  661.  
  662.   VT.SET_POSITION( VT.XY_POSITION'(6, 25) ) ;
  663.   VT.PUT("Strike a key to invoke the tab...") ;
  664.   VT.SET_POSITION( VT.XY_POSITION'(4, 1) ) ;
  665.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  666.  
  667.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  668.  
  669.   VT.TAB ;
  670.  
  671.   VT.SET_POSITION( VT.XY_POSITION'(8, 25) ) ;
  672.   VT.PUT("As you can see no operation has occurred.") ;
  673.   VT.SET_POSITION( VT.XY_POSITION'(9, 25) ) ;
  674.   VT.PUT("Strike a key to continue...") ;
  675.   VT.SET_POSITION( VT.XY_POSITION'(4, 1) ) ;
  676.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  677.  
  678.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  679. ------------------------------------------------------
  680.   VT.SET_POSITION( VT.XY_POSITION'(12, 25) ) ;
  681.   VT.PUT("Tab stops will be set in columns 5 and 25,") ;
  682.   VT.SET_POSITION( VT.XY_POSITION'(13, 25) ) ;
  683.   VT.PUT("first we will TAB(2) to move to the second") ;
  684.   VT.SET_POSITION( VT.XY_POSITION'(14, 25) ) ;
  685.   VT.PUT("tab stop then move down a line and do a") ;
  686.   VT.SET_POSITION( VT.XY_POSITION'(15, 25) ) ;
  687.   VT.PUT("single tab. Strike a key to show results.") ;
  688.   VT.UPDATE_SCREEN( 12, 15 ) ;
  689.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  690.  
  691.   VT.SET_POSITION( VT.XY_POSITION'(5,  5) ) ;
  692.   VT.SET_TAB ;
  693.  
  694.   VT.SET_POSITION( VT.XY_POSITION'(1, 25) ) ;
  695.   VT.SET_TAB ;
  696.  
  697.   VT.SET_POSITION( VT.XY_POSITION'(17, 1) ) ;
  698.   VT.TAB( 2 ) ;
  699.   VT.PUT('C') ;
  700.   VT.SET_POSITION( VT.XY_POSITION'(21, 15) ) ;
  701.   VT.PUT("The first 'C' indicates the cursor position after TAB(2).") ;
  702.   VT.SET_POSITION( VT.XY_POSITION'(18, 1) ) ;
  703.   VT.TAB ;
  704.   VT.PUT('C') ;
  705.   VT.SET_POSITION( VT.XY_POSITION'(22, 15) ) ;
  706.   VT.PUT("The second 'C' indicates the cursor position after a single tab.") ;
  707.   VT.SET_POSITION( VT.XY_POSITION'(24, 31) ) ;
  708.   VT.PUT("Strike a key to continue...") ;
  709.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  710.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  711. ------------------------------------------------------------------
  712.  
  713.   VT.SET_POSITION( VT.XY_POSITION'(3, 1) ) ;
  714.   VT.ERASE_IN_DISPLAY( VT.FROM_XY_POSITION_TO_END ) ;
  715.  
  716.   VT.SET_POSITION( VT.XY_POSITION'(5, 25) ) ;
  717.   VT.PUT("We left the top two lines to help illustrate ") ;
  718.   VT.SET_POSITION( VT.XY_POSITION'(6, 25) ) ;
  719.   VT.PUT("the insert_line functionality of the VT.") ;
  720.   VT.SET_POSITION( VT.XY_POSITION'(8, 25) ) ;
  721.   VT.PUT("We will insert one line on the top of the display.") ;
  722.   VT.SET_POSITION( VT.XY_POSITION'(9, 25) ) ;
  723.   VT.PUT("Strike a key to show results.") ;
  724.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  725.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  726. -- --------------------------------------------------
  727.   VT.SET_POSITION( VT.XY_POSITION'(1, 1) ) ;    --one new line should be
  728.   VT.INSERT_LINE ;                              --inserted at the top
  729.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  730.  
  731.  
  732.   VT.SET_POSITION( VT.XY_POSITION'(13,10) ) ;
  733.   VT.PUT("Notice how the display scrolls down when lines are inserted.") ;
  734.   VT.SET_POSITION( VT.XY_POSITION'(15,25) ) ;
  735.   VT.PUT("Strike a key to continue...") ;
  736.  
  737.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  738.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;    --then 3 more
  739.   VT.SET_POSITION( VT.XY_POSITION'(18, 25) ) ;
  740.   VT.PUT("Now 3 more lines inserted at the top.") ;
  741.  
  742.   VT.SET_POSITION( VT.XY_POSITION'(20, 25) ) ;
  743.   VT.PUT("Strike a key to continue...") ;
  744.   VT.SET_POSITION( VT.XY_POSITION'(1 ,1) ) ;
  745.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  746.  
  747.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  748. -------------------------------------------------
  749.   VT.INSERT_LINE( 3 ) ;
  750.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  751.  
  752.   VT.SET_POSITION( VT.XY_POSITION'(24, 25) ) ;
  753.   VT.PUT("Hit another key to move on...") ;
  754.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  755.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  756. ---------------------
  757.   VT.ERASE_IN_DISPLAY( VT.ALL_POSITIONS ) ;
  758. ---------------------
  759.   VT.SET_POSITION( VT.XY_POSITION'(1, 1) ) ;   --top of the display.
  760.   vt.put("Top of the display.") ;
  761.  
  762.   VT.SET_POSITION( VT.XY_POSITION'(24, 1) ) ;   --bottom of the display.
  763.   VT.PUT("This is the bottom row, it will be lost when insert_line is called");
  764.   VT.SET_POSITION( VT.XY_POSITION'(12, 25) ) ;
  765.   VT.PUT("Strike a key to insert a line.") ;
  766.   VT.SET_POSITION( VT.XY_POSITION'(14, 25) ) ;
  767.   VT.PUT("The display will scroll down and the ") ;
  768.   VT.SET_POSITION( VT.XY_POSITION'(15, 25) ) ;
  769.   VT.PUT("bottom line will be lost.") ;
  770.  
  771.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  772.  
  773.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;    --wait for signal...
  774.  
  775.   VT.SET_POSITION( VT.XY_POSITION'(10, 25) ) ;
  776.  
  777.   VT.INSERT_LINE ;                              --new blank bottom line
  778.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  779.  
  780.   VT.SET_POSITION( VT.XY_POSITION'(20, 25) ) ;
  781.   VT.PUT("Strike a key to move to a new page...") ;
  782.  
  783.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  784.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  785. -- ----------------------------------------------------
  786.  
  787.   VT.SET_POSITION( VT.XY_POSITION'(20, 20) ) ;  --any coordinates will do
  788.   VT.ERASE_IN_DISPLAY( VT.ALL_POSITIONS ) ;
  789.   VT.SET_POSITION( VT.XY_POSITION'(1 , 1) ) ;
  790.  
  791.   VT.SET_POSITION( VT.XY_POSITION'(24, 20) ) ;
  792.   VT.PUT("Display now shows a new page, strike a key to continue.") ;
  793.   VT.UPDATE_SCREEN( 1, vt_content.height ) ;
  794.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  795.  
  796.   vt.erase_in_display( vt.all_positions ) ;
  797. --
  798. -- testing writing on the display and ringing
  799. -- the terminal's bell.
  800. --
  801. --
  802.   VT.SET_POSITION( VT.XY_POSITION'(5, 20) ) ;
  803.   VT.PUT("Tests for putting data on the display ") ;
  804.   VT.SET_POSITION( VT.XY_POSITION'(6, 15) ) ;
  805.   VT.PUT("and ringing the bell for the page mode terminal,") ;
  806.   VT.SET_POSITION( VT.XY_POSITION'(7, 15) ) ;
  807.   VT.PUT("refer to sections 3.3.3.14 and 3.3.3.16 of the") ;
  808.   VT.SET_POSITION( VT.XY_POSITION'(8, 15) ) ;
  809.   VT.PUT("Test Procedures document.") ;
  810.  
  811.   VT.SET_POSITION( VT.XY_POSITION'(24, 45) ) ;
  812.   VT.PUT("...strike any key to continue.") ;
  813.   vt.update_screen( 1, vt_content.height ) ;
  814.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  815.   VT.ERASE_IN_DISPLAY( VT.ALL_POSITIONS ) ;
  816.   VT.SET_POSITION( VT.XY_POSITION'(1, 1) ) ;
  817.  
  818. --VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;    --one position past the '.'
  819.   VT.SET_POSITION( VT.XY_POSITION'(2, 25) ) ;
  820.   VT.PUT("The cursor should be located one column past ");
  821.   VT.SET_POSITION( VT.XY_POSITION'(3, 20) ) ;
  822.   VT.PUT("the last character put on the display.") ;
  823.  
  824.   VT.SET_POSITION( VT.XY_POSITION'(1, 1) ) ;
  825.   VT.PUT("Here I am.") ;
  826.   vt.update_screen( 1, vt_content.height ) ;
  827.  
  828.  
  829.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;    --one position past the '.'
  830.  
  831.   VT.SET_POSITION( VT.XY_POSITION'(6, 1) ) ;
  832.   VT.PUT('x') ;
  833.   VT.SET_POSITION( VT.XY_POSITION'(6, 25) ) ;
  834.   VT.PUT("Both strings and single characters can") ;
  835.   VT.SET_POSITION( VT.XY_POSITION'(7, 20) ) ;
  836.   VT.PUT("be written on the display.") ;
  837.   VT.SET_POSITION( VT.XY_POSITION'(9, 30) ) ;
  838.   VT.PUT("...strike a key to continue.") ;
  839.   vt.update_screen( 6, 9 ) ;
  840.  
  841.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;    --put single character
  842.  
  843. --VT.SET_POSITION( VT.XY_POSITION'(15, 60) ) ;    --line too long for
  844. --VT.PUT("The end of this string will be lost.") ;--remainder of screen
  845. --VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  846. -- --------------------------------------------
  847.   VT.SET_POSITION( VT.XY_POSITION'(22, 10) ) ;
  848.   VT.PUT("Press a key to ring the terminal's bell, and continue.") ;
  849.  
  850.   vt.update_screen( 22, 22 ) ;
  851.  
  852.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;     --wait for signal
  853.  
  854.   VT.BELL ;  VT.BELL ; VT.BELL ;                 --ring bell 3 times
  855.  
  856.   VT.erase_in_display( vt.all_positions ) ;
  857. --
  858. -- testing delete character and delete line
  859. --
  860. --
  861. --
  862.   VT.SET_POSITION( VT.XY_POSITION'(5, 20) ) ;
  863.   VT.PUT("Tests for delete_character and delete_line for") ;
  864.   VT.SET_POSITION( VT.XY_POSITION'(6, 15) ) ;
  865.   VT.PUT("the page_mode terminal, refer to sections 3.3.3.17") ;
  866.   VT.SET_POSITION( VT.XY_POSITION'(7, 15) ) ;
  867.   VT.PUT("and 3.3.3.18 of the test document.") ;
  868.   VT.SET_POSITION( VT.XY_POSITION'(24, 45) ) ;
  869.   VT.PUT("...strike any key to continue.") ;
  870.   vt.update_screen( 1, vt_content.height ) ;
  871.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  872.   VT.ERASE_IN_DISPLAY( VT.ALL_POSITIONS ) ;
  873.   VT.SET_POSITION( VT.XY_POSITION'(1, 1) ) ;
  874.  
  875.   VT.SET_POSITION( VT.XY_POSITION'(5, 15) ) ;
  876.   VT.PUT("Let's put some lines of data on the display so we can") ;
  877.   VT.SET_POSITION( VT.XY_POSITION'(6, 15) ) ;
  878.   VT.PUT("illustrate delete_character and delete_line.") ;
  879.   VT.SET_POSITION( VT.XY_POSITION'(8, 45) ) ;
  880.   VT.PUT("Strike a key to continue...") ;
  881.   vt.update_screen( 1, vt_content.height ) ;
  882.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  883.  
  884.   VT.SET_POSITION( VT.XY_POSITION'(10, 1) ) ;
  885.   VT.PUT("This is our first line of data.") ;
  886.  
  887.   VT.SET_POSITION( VT.XY_POSITION'(11, 1) ) ;
  888.   VT.PUT("This is our second line of data.") ;
  889.  
  890.   VT.SET_POSITION( VT.XY_POSITION'(12, 1) ) ;
  891.   VT.PUT("This is our third line of data.") ;
  892.  
  893.   VT.SET_POSITION( VT.XY_POSITION'(13, 1) ) ;
  894.   VT.PUT("This is our fourth line of data.") ;
  895. -------------
  896.   VT.SET_POSITION( VT.XY_POSITION'(15, 30) ) ;
  897.   VT.PUT("Let's delete the second and third lines.") ;
  898.  
  899.   VT.SET_POSITION( VT.XY_POSITION'(17, 30) ) ;
  900.   VT.PUT("Strike a key to see results...") ;
  901.   VT.SET_POSITION( VT.XY_POSITION'(11, 1) ) ;
  902.   vt.update_screen( 1, vt_content.height ) ;
  903.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  904.  
  905.   VT.DELETE_LINE(2) ;
  906.  
  907.   VT.SET_POSITION( VT.XY_POSITION'(17, 30) ) ;
  908.   VT.PUT("Hit any key to move on...") ;
  909.   vt.update_screen( 10 , 17) ;
  910.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  911. -------------------
  912.   VT.SET_POSITION( VT.XY_POSITION'(19, 30) ) ;
  913.   VT.PUT("Now let's delete some characters.") ;
  914.  
  915.   VT.SET_POSITION( VT.XY_POSITION'(20, 30) ) ;
  916.   VT.PUT("We will position the cursor on the 'f' of fourth,") ;
  917.  
  918.   VT.SET_POSITION( VT.XY_POSITION'(21, 30) ) ;
  919.   VT.PUT("and delete six characters.") ;
  920.  
  921.   VT.SET_POSITION( VT.XY_POSITION'(23, 30) ) ;
  922.   VT.PUT("Strike a key to see results...") ;
  923.   VT.SET_POSITION( VT.XY_POSITION'(11, 13) ) ;
  924.   vt.update_screen( 1, vt_content.height ) ;
  925.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  926.  
  927.   VT.DELETE_CHARACTER(6) ;
  928.   VT.SET_POSITION( VT.XY_POSITION'(12, 1) ) ;
  929.   VT.ERASE_IN_DISPLAY( VT.FROM_XY_POSITION_TO_END ) ;
  930.  
  931.   VT.SET_POSITION( VT.XY_POSITION'(15, 30) ) ;
  932.   VT.PUT("'fourth' should be deleted from the display.") ;
  933.  
  934.   VT.SET_POSITION( VT.XY_POSITION'(17, 30) ) ;
  935.   VT.PUT("Strike a key to continue...") ;
  936.   vt.update_screen( 1, vt_content.height ) ;
  937.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  938.  
  939.   VT.ERASE_IN_DISPLAY( VT.ALL_POSITIONS ) ;
  940. --------------------
  941.   VT.SET_POSITION( VT.XY_POSITION'(10, 25) ) ;
  942.   VT.PUT("We will call the delete routines with a ") ;
  943.   VT.SET_POSITION( VT.XY_POSITION'(11, 25) ) ;
  944.   VT.PUT("parameter greater than the number of characters") ;
  945.   VT.SET_POSITION( VT.XY_POSITION'(12, 25) ) ;
  946.   VT.PUT("(or lines) left on the line (or display).") ;
  947.  
  948.   VT.SET_POSITION( VT.XY_POSITION'(14, 25) ) ;
  949.   VT.PUT("Press a key to see the data...") ;
  950.   vt.update_screen( 1, vt_content.height ) ;
  951.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  952.  
  953.   VT.SET_POSITION( VT.XY_POSITION'(16, 25) ) ;
  954.   VT.PUT("Let's first delete from the 'l' in 'line' ") ;
  955.   VT.SET_POSITION( VT.XY_POSITION'(17, 25) ) ;
  956.   VT.PUT("by calling DELETE_CHARACTER( 25 ).") ;
  957.  
  958.   VT.SET_POSITION( VT.XY_POSITION'(22, 1) ) ;
  959.   VT.PUT("This is our first line of data.") ;
  960.  
  961.   VT.SET_POSITION( VT.XY_POSITION'(23, 1) ) ;
  962.   VT.PUT("This is our second line of data.") ;
  963.  
  964.   VT.SET_POSITION( VT.XY_POSITION'(24, 1) ) ;
  965.   VT.PUT("This is our last line of data.") ;
  966.  
  967.   VT.SET_POSITION( VT.XY_POSITION'(19, 25) ) ;
  968.   VT.PUT("Press a key to see the results...") ;
  969.   VT.SET_POSITION( VT.XY_POSITION'(22, 19) ) ;
  970.   vt.update_screen( 1, vt_content.height ) ;
  971.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  972.  
  973.   VT.SET_POSITION( VT.XY_POSITION'(22, 19) ) ;
  974.   VT.DELETE_CHARACTER(25) ;
  975.   vt.update_screen( 22, 22 ) ;
  976.  
  977.   VT.SET_POSITION( VT.XY_POSITION'(20, 1) ) ;
  978.   VT.ERASE_IN_DISPLAY( VT.FROM_START_TO_XY_POSITION ) ;
  979.  
  980.   VT.SET_POSITION( VT.XY_POSITION'(10, 25) ) ;
  981.   VT.PUT("The characters from the 'l' on should") ;
  982.   VT.SET_POSITION( VT.XY_POSITION'(11, 25) ) ;
  983.   VT.PUT("be deleted.  Now we will call DELETE_LINE(5)") ;
  984.   VT.SET_POSITION( VT.XY_POSITION'(12, 25) ) ;
  985.   VT.PUT("from the word 'second'.  ") ;
  986.  
  987.   VT.SET_POSITION( VT.XY_POSITION'(14, 25) ) ;
  988.   VT.PUT("Strike a key to continue...") ;
  989.  
  990.   vt.update_screen( 1, vt_content.height ) ;
  991.   VT.SET_POSITION( VT.XY_POSITION'(23, 13) ) ;
  992.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  993.   VT.SET_POSITION( VT.XY_POSITION'(23, 13) ) ;
  994.   VT.DELETE_LINE(5) ;
  995.  
  996.   VT.SET_POSITION( VT.XY_POSITION'(24, 45) ) ;
  997.   VT.PUT("Strike a key to continue...") ;
  998.   vt.update_screen( 1, vt_content.height ) ;
  999.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  1000.  
  1001.  
  1002.   VT.erase_in_display( vt.all_positions ) ;
  1003. --
  1004. -- testing erase_in_line and inserting
  1005. -- characters on the display
  1006. --
  1007. --
  1008.   VT.SET_POSITION( VT.XY_POSITION'(5, 20) ) ;
  1009.   VT.PUT("Tests for erase_in_line and inserting characters") ;
  1010.   VT.SET_POSITION( VT.XY_POSITION'(6, 15) ) ;
  1011.   VT.PUT("on the display for the page mode terminal, refer") ;
  1012.   VT.SET_POSITION( VT.XY_POSITION'(7, 15) ) ;
  1013.   VT.PUT("to sections 3.3.3.20 and 3.3.3.21 of the Test" ) ;
  1014.   VT.SET_POSITION( VT.XY_POSITION'(8, 15) ) ;
  1015.   VT.PUT("Procedures document.") ;
  1016.   VT.SET_POSITION( VT.XY_POSITION'(24, 45) ) ;
  1017.   VT.PUT("...strike any key to continue.") ;
  1018.   vt.update_screen( 1, vt_content.height ) ;
  1019.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  1020.   VT.ERASE_IN_DISPLAY( VT.ALL_POSITIONS ) ;
  1021.   VT.SET_POSITION( VT.XY_POSITION'(1, 1) ) ;
  1022.  
  1023.   VT.SET_POSITION( VT.XY_POSITION'(5, 15) ) ;
  1024.   VT.PUT("Let's put some lines of data on the display so we can") ;
  1025.   VT.SET_POSITION( VT.XY_POSITION'(6, 15) ) ;
  1026.   VT.PUT("illustrate erase_in_line and inserting characters.") ;
  1027.   VT.SET_POSITION( VT.XY_POSITION'(8, 45) ) ;
  1028.   VT.PUT("Strike a key to continue...") ;
  1029.   vt.update_screen( 1, vt_content.height ) ;
  1030.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  1031.  
  1032.   VT.SET_POSITION( VT.XY_POSITION'(10, 1) ) ;
  1033.   VT.PUT("This is our first line of data.") ;
  1034.  
  1035.   VT.SET_POSITION( VT.XY_POSITION'(11, 1) ) ;
  1036.   VT.PUT("This is our second line of data.") ;
  1037.  
  1038.   VT.SET_POSITION( VT.XY_POSITION'(12, 1) ) ;
  1039.   VT.PUT("This is our third line of data.") ;
  1040.  
  1041.   VT.SET_POSITION( VT.XY_POSITION'(13, 1) ) ;
  1042.   VT.PUT("This is our fourth line of data.") ;
  1043. -------------
  1044.   VT.SET_POSITION( VT.XY_POSITION'(15, 30) ) ;
  1045.   VT.PUT("Let's erase from the start of the first line") ;
  1046.   VT.SET_POSITION( VT.XY_POSITION'(16, 30) ) ;
  1047.   VT.PUT("to the cursor.") ;
  1048.   VT.SET_POSITION( VT.XY_POSITION'(18, 30) ) ;
  1049.   VT.PUT("Strike a key to see results...") ;
  1050.   VT.SET_POSITION( VT.XY_POSITION'(10, 17) ) ;
  1051.   vt.update_screen( 1, vt_content.height ) ;
  1052.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  1053.  
  1054.   VT.ERASE_IN_LINE( VT.FROM_START_TO_XY_POSITION ) ;
  1055.   VT.SET_POSITION( VT.XY_POSITION'(24, 45) ) ;
  1056.   VT.PUT("...strike a key to continue.") ;
  1057.   vt.update_screen( 10, vt_content.height ) ;
  1058.   vt.get( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  1059.   VT.SET_POSITION( VT.XY_POSITION'(15, 1) ) ;
  1060.   VT.ERASE_IN_DISPLAY(VT.FROM_XY_POSITION_TO_END ) ;
  1061.  
  1062.   VT.SET_POSITION( VT.XY_POSITION'(15, 30) ) ;
  1063.   VT.PUT("Now let's erase from the cursor to the end of") ;
  1064.   VT.SET_POSITION( VT.XY_POSITION'(16, 30) ) ;
  1065.   VT.PUT("the line.") ;
  1066.   VT.SET_POSITION( VT.XY_POSITION'(18, 30) ) ;
  1067.   VT.PUT("Strike a key to see results...") ;
  1068.   VT.SET_POSITION( VT.XY_POSITION'(11, 12) ) ;
  1069.   vt.update_screen( 1, vt_content.height ) ;
  1070.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  1071.   VT.ERASE_IN_LINE( VT.FROM_XY_POSITION_TO_END ) ;
  1072.  
  1073.   VT.SET_POSITION( VT.XY_POSITION'(24, 45) ) ;
  1074.   VT.PUT("...strike a key to continue.") ;
  1075.   vt.update_screen( 1, vt_content.height ) ;
  1076.   vt.get( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  1077.   VT.SET_POSITION( VT.XY_POSITION'(15, 1) ) ;
  1078.   VT.ERASE_IN_DISPLAY(VT.FROM_XY_POSITION_TO_END ) ;
  1079.  
  1080.   VT.SET_POSITION( VT.XY_POSITION'(15, 30) ) ;
  1081.   VT.PUT("Now let's try to insert some characters ") ;
  1082.   VT.SET_POSITION( VT.XY_POSITION'(16, 30) ) ;
  1083.   VT.PUT("on the display. We will insert the string") ;
  1084.   VT.SET_POSITION( VT.XY_POSITION'(17, 30) ) ;
  1085.   VT.PUT("'THIS IS A TEST' starting in column 1 of") ;
  1086.   VT.SET_POSITION( VT.XY_POSITION'(18, 30) ) ;
  1087.   VT.PUT("our third line of data.") ;
  1088.  
  1089.   VT.SET_POSITION( VT.XY_POSITION'(20, 30) ) ;
  1090.   VT.PUT("Strike a key to see the results...") ;
  1091.   vt.update_screen( 1, vt_content.height ) ;
  1092.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  1093.  
  1094.   VT.ENTER_INSERT_MODE ;
  1095.   VT.SET_POSITION( VT.XY_POSITION'(12, 1) ) ;
  1096.   VT.PUT("THIS IS A TEST ") ;
  1097.   VT.EXIT_INSERT_MODE ;
  1098.   VT.SET_POSITION( VT.XY_POSITION'(15, 1) ) ;
  1099.   VT.ERASE_IN_DISPLAY( VT.FROM_XY_POSITION_TO_END ) ;
  1100.  
  1101.   VT.SET_POSITION( VT.XY_POSITION'(15, 30) ) ;
  1102.   VT.PUT("The characters to the right of the inserted") ;
  1103.   VT.SET_POSITION( VT.XY_POSITION'(16, 30) ) ;
  1104.   VT.PUT("text should haved shifted to the right enough") ;
  1105.   VT.SET_POSITION( VT.XY_POSITION'(17, 30) ) ;
  1106.   VT.PUT("to make room for the new data.") ;
  1107.   VT.SET_POSITION( VT.XY_POSITION'(19, 30) ) ;
  1108.   VT.PUT("Strike a key to continue...") ;
  1109.   vt.update_screen( 1, vt_content.height ) ;
  1110.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS) ;
  1111.  
  1112.   VT.SET_POSITION( VT.XY_POSITION'(15, 1) ) ;
  1113.   VT.ERASE_IN_DISPLAY( VT.FROM_XY_POSITION_TO_END ) ;
  1114.   VT.SET_POSITION( VT.XY_POSITION'(15, 30) ) ;
  1115.   VT.PUT("We are now out of insert_mode so any ") ;
  1116.   VT.SET_POSITION( VT.XY_POSITION'(16, 30) ) ;
  1117.   VT.PUT("data written to the screen should replace") ;
  1118.   VT.SET_POSITION( VT.XY_POSITION'(17, 30) ) ;
  1119.   VT.PUT("whatever is presently in that position.") ;
  1120.   VT.SET_POSITION( VT.XY_POSITION'(18, 30) ) ;
  1121.   VT.PUT("Let's give it a try.") ;
  1122.   VT.SET_POSITION( VT.XY_POSITION'(20, 30) ) ;
  1123.   VT.PUT("Strike a key to continue...") ;
  1124.   vt.update_screen( 1, vt_content.height ) ;
  1125.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS) ;
  1126.  
  1127.  
  1128.   VT.SET_POSITION( VT.XY_POSITION'(15, 1) ) ;
  1129.   VT.ERASE_IN_DISPLAY( VT.FROM_XY_POSITION_TO_END ) ;
  1130.   VT.SET_POSITION( VT.XY_POSITION'(13, 13) ) ;
  1131.   VT.PUT("new   ") ;
  1132.  
  1133.   VT.SET_POSITION( VT.XY_POSITION'(15, 30) ) ;
  1134.   VT.PUT("The word 'fourth' should be replaced by 'new   '.") ;
  1135.   VT.SET_POSITION( VT.XY_POSITION'(16, 30) ) ;
  1136.   VT.PUT("As you can see we are no longer in insert_mode.") ;
  1137.   VT.SET_POSITION( VT.XY_POSITION'(19, 30) ) ;
  1138.   VT.PUT("Strike a key to continue...") ;
  1139.   vt.update_screen( 1, vt_content.height ) ;
  1140.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS) ;
  1141.  
  1142.  
  1143.   VT.erase_in_display( vt.all_positions ) ;
  1144. --
  1145. -- testing setting the graphic rendition
  1146. -- on the page_mode terminal
  1147. --
  1148.   VT.SET_POSITION( VT.XY_POSITION'(5, 20) ) ;
  1149.   VT.PUT("Tests for setting the graphic rendition on") ;
  1150.   VT.SET_POSITION( VT.XY_POSITION'(6, 15) ) ;
  1151.   VT.PUT("the page mode terminal, refer to section") ;
  1152.   VT.SET_POSITION( VT.XY_POSITION'(7, 15) ) ;
  1153.   VT.PUT("3.3.3.23 of the Test Procedures document.") ;
  1154.   VT.SET_POSITION( VT.XY_POSITION'(24, 45) ) ;
  1155.   VT.PUT("...strike any key to continue.") ;
  1156.   vt.update_screen( 1, vt_content.height ) ;
  1157.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  1158.   VT.ERASE_IN_DISPLAY( VT.ALL_POSITIONS ) ;
  1159.   VT.SET_POSITION( VT.XY_POSITION'(1, 1) ) ;
  1160.  
  1161.   VT.SET_POSITION( VT.XY_POSITION'(10, 5 ) ) ;
  1162.   VT.PUT("The following data should be highlited ===>>") ;
  1163.   VT.SELECT_GRAPHIC_RENDITION( VT.REVERSE_IMAGE ) ;
  1164.   VT.SET_POSITION( VT.XY_POSITION'(10, 49) ) ;
  1165.   VT.PUT("In otherwords, reverse image!") ;
  1166.   VT.SET_POSITION( VT.XY_POSITION'(18, 40) ) ;
  1167.   VT.PUT("Strike a key to get back to normal...") ;
  1168.   vt.update_screen( 1, vt_content.height ) ;
  1169.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  1170.  
  1171.   VT.SELECT_GRAPHIC_RENDITION( VT.PRIMARY_RENDITION ) ;
  1172.   VT.SET_POSITION( VT.XY_POSITION'(20, 35) ) ;
  1173.   VT.PUT("This should be in the primary rendition.") ;
  1174.   VT.SET_POSITION( VT.XY_POSITION'(22, 35) ) ;
  1175.   VT.PUT("Hit a key to move on...") ;
  1176.   vt.update_screen( 1, vt_content.height ) ;
  1177.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  1178.  
  1179.   VT.erase_in_display( vt.all_positions ) ;
  1180.   vt.update_screen( 1, vt_content.height ) ;
  1181.  
  1182.   VT.SET_POSITION( VT.XY_POSITION'(5, 20) ) ;
  1183.   VT.PUT("Test for reading characters from the keyboard for") ;
  1184.   VT.SET_POSITION( VT.XY_POSITION'(6, 15) ) ;
  1185.   VT.PUT("the page mode terminal, refer to section 3.3.3.15") ;
  1186.   VT.SET_POSITION( VT.XY_POSITION'(7, 15) ) ;
  1187.   VT.PUT("of the Test Procedures document.") ;
  1188.   VT.SET_POSITION( VT.XY_POSITION'(24, 45) ) ;
  1189.   VT.PUT("...strike any key to continue.") ;
  1190.   vt.update_screen( 5, vt_content.height ) ;
  1191.   vt.get( data, last, keys ) ;
  1192.   VT.ERASE_IN_DISPLAY( VT.ALL_POSITIONS ) ;
  1193.   vt.update_screen( 1, vt_content.height ) ;
  1194.  
  1195.   VT.SET_POSITION( VT.XY_POSITION'(9, 15) ) ;
  1196.   VT.PUT("Type some keys and function keys from the keyboard, this") ;
  1197.   VT.SET_POSITION( VT.XY_POSITION'(10,15) ) ;
  1198.   VT.PUT("test will redisplay the keys you strike to the display.") ;
  1199.   VT.SET_POSITION( VT.XY_POSITION'(12,15) ) ;
  1200.   VT.PUT("You must hit the '#' key to exit from this process....");
  1201.   VT.SET_POSITION( VT.XY_POSITION'(15,1 ) ) ;
  1202.   vt.update_screen( 9, 15 ) ;
  1203.  
  1204.      LOOP
  1205.         vt.get( data, last, keys ) ;
  1206.  
  1207.         num_function_keys := vt.function_count( keys ) ;
  1208.         IF last = 0
  1209.         THEN
  1210.             IF  num_function_keys = 0
  1211.             THEN
  1212.                 NULL ;
  1213.             ELSE
  1214.                 FOR i IN 1..num_function_keys
  1215.                 LOOP
  1216.                    vt.function_key( keys, i, key_id2, prev_pos ) ;
  1217.                    vt.function_key_name( key_id2, key_name, key_last ) ;
  1218.                    vt.put( right_arrow ) ;
  1219.                    vt.put( key_name(1..key_last) ) ;
  1220.                    vt.put( left_arrow ) ;
  1221.                 END LOOP ;
  1222.             END IF ;
  1223.         ELSE
  1224.             IF num_function_keys = 0
  1225.             THEN
  1226.                vt.put( data( 1..last ) ) ;
  1227.  
  1228.             ELSE
  1229.                last_position := 1 ;
  1230.                FOR i IN 1..num_function_keys
  1231.                LOOP
  1232.                   vt.function_key(keys, i, key_id2, prev_pos )  ;
  1233.                   IF prev_pos /= 0
  1234.                   THEN
  1235.                       vt.put( data(last_position..prev_pos) ) ;
  1236.                       last_position := prev_pos + 1 ;
  1237.  
  1238.                   END IF ;
  1239.                   vt.function_key_name( key_id2, key_name, key_last ) ;
  1240.                   vt.put(right_arrow);
  1241.                   vt.put( key_name(1..key_last) ) ;
  1242.                   vt.put(left_arrow);
  1243.                END LOOP ;
  1244.  
  1245.                IF last_position <= last
  1246.                THEN
  1247.                    vt.put( data( last_position..last ) ) ;
  1248.                END IF ;
  1249.  
  1250.            END IF ;
  1251.         END IF ;
  1252.         vt.update_line( 15  ) ; -- It will be this thru out the test
  1253.  
  1254.         IF last /= 0
  1255.         THEN
  1256.            EXIT WHEN data(last) = '#' ;
  1257.         END IF ;
  1258.  
  1259.      END LOOP ;
  1260.  
  1261.   vt.erase_in_display( vt.all_positions ) ;
  1262.   vt.update_screen( 1, vt_content.height ) ;
  1263. --
  1264. --
  1265. --  Abstract :  The following section of this test file will fully test
  1266. --              the functionalities as proposed in the Specification
  1267. --              Document.
  1268. --
  1269. --              The person testing these requirements might follow along
  1270. --              in the Specification document to verify each test performed.
  1271. --
  1272. --
  1273. --
  1274. --
  1275. -- This Ada program produces the introduction for the scroll_mode
  1276. --  testing to be done by the user.
  1277. --
  1278.   VT.SET_POSITION( VT.XY_POSITION'(10, 18) ) ;
  1279.   VT.SELECT_GRAPHIC_RENDITION( VT.REVERSE_IMAGE ) ;
  1280.  
  1281.   VT.PUT("  INTERACTIVE TEST FOR THE SCROLL MODE TERMINAL  ") ;
  1282.   VT.SET_POSITION( VT.XY_POSITION'(12, 29) ) ;
  1283.   VT.PUT("  OF THE VIRTUAL TERMINAL  ") ;
  1284.  
  1285.   VT.SET_POSITION( VT.XY_POSITION'(24, 50) ) ;
  1286.   VT.SELECT_GRAPHIC_RENDITION( VT.PRIMARY_RENDITION ) ;
  1287.  
  1288.   VT.PUT("...strike any key to continue." ) ;
  1289.   vt.update_screen( 10, vt_content.height ) ;
  1290.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  1291.   vt.erase_in_display( vt.all_positions ) ;
  1292.   vt.set_position( vt.xy_position'(24, 1) ) ;
  1293.   vt.update_screen( 1, vt_content.height ) ;
  1294.  
  1295.   VT.CLOSE ;
  1296.  
  1297.      st.open ;
  1298.  
  1299.      st.new_line ;
  1300.      st.put("   This test will cover the following functionalities of the") ;
  1301.      st.new_line ;
  1302.      st.put("scroll terminal(the section of the Test document is included).") ;
  1303.      st.new_line ;
  1304.      st.new_line ;
  1305.      st.put("writing data to the screen( 3.3.3.6 ),") ;
  1306.      st.new_line ;
  1307.      st.put("moving to a new_line( 3.3.3.4 )," ) ;
  1308.      st.new_line ;
  1309.      st.put("setting tab stops( 3.3.3.1 ),") ;
  1310.      st.new_line ;
  1311.      st.put("clearing tab stops( 3.3.3.2 ), and") ;
  1312.      st.new_line ;
  1313.      st.put("moving by tab stops on the display( 3.3.3.3 ).") ;
  1314.      st.new_line ;
  1315.      st.new_line ;
  1316.      st.put("Strike a key to continue...") ;
  1317.      st.update_line ;
  1318.      st.get( data, last, keys2 ) ;
  1319.  
  1320.      st.new_line ;
  1321.      st.new_line ;
  1322.      st.put("Writing to the display and moving to a new line are used") ;
  1323.      st.new_line ;
  1324.      st.put("extensively throughout the testing of the scroll terminal,");
  1325.      st.new_line ;
  1326.      st.put("therefore they will not be 'explicitly' tested.") ;
  1327.      st.new_line ;
  1328.      st.put("Strike a key to continue...") ;
  1329.      st.update_line ;
  1330.      st.get( data, last, keys2 ) ;
  1331.      st.new_line ;
  1332.      st.new_line ;
  1333.      st.set_position(1) ;
  1334.      st.put("my_prompt>") ;
  1335.  
  1336.      st.update_line ;
  1337.      st.set_position( 1 ) ;
  1338.      st.put("This is a test") ;
  1339.  
  1340.      st.new_line ;
  1341.      st.new_line ;
  1342.      st.put("Now let's test the set_tab and tab functionalities.") ;
  1343.      st.new_line ;
  1344.      st.put("Tabs have been set in columns 10 and 22, we will tab to those") ;
  1345.      st.new_line ;
  1346.      st.put("and write an 'X'.") ;
  1347.      st.new_line ;
  1348.      st.put("Strike a key to continue...") ;
  1349.      st.update_line ;
  1350.      st.get( data, last, keys2 ) ;
  1351.      st.new_line ;
  1352.  
  1353.      st.set_position(10) ;
  1354.      st.set_tab ;
  1355.      st.set_position(22) ;
  1356.      st.set_tab ;
  1357.      st.new_line ;
  1358.      st.new_line ;
  1359.      st.tab ;
  1360.      st.put('X') ;
  1361.      st.tab ;
  1362.      st.put('X') ;
  1363.      st.update_line ;
  1364.  
  1365.      st.set_position(1) ;
  1366.      st.put("  The 'X's indicate where the tab stops are.") ;
  1367.  
  1368.      st.new_line ;
  1369.      st.new_line ;
  1370.      st.put("Strike a key to continue...") ;
  1371.      st.update_line ;
  1372.      st.get( data, last, keys2 ) ;
  1373.      st.new_line ;
  1374.      st.new_line ;
  1375.      st.put("Now let's test the clear tab functionality.");
  1376.      st.new_line ;
  1377.      st.put("We will first tab over to the first tab stop then clear it.");
  1378.      st.new_line ;
  1379.      st.put("Strike a key to do this....") ;
  1380.      st.update_line ;
  1381.      st.get( data, last, keys2 ) ;
  1382.  
  1383.      st.new_line ;
  1384.      st.new_line ;
  1385.      st.put("The tab stop has been cleared, we will call tab once and") ;
  1386.      st.new_line ;
  1387.      st.put("print an 'X'. It should be below the second 'X' above.") ;
  1388.      st.new_line ;
  1389.      st.tab ;
  1390.      st.clear_tab ;
  1391.      st.new_line ;
  1392.      st.put("Strike a key to see the results...") ;
  1393.      st.update_line ;
  1394.      st.get( data, last, keys2 ) ;
  1395.      st.new_line ;
  1396.      st.new_line ;
  1397.      st.tab ;
  1398.      st.put('X') ;
  1399.      st.new_line ;
  1400.      st.tab ;
  1401.      st.clear_tab;
  1402.      st.new_line;
  1403.      st.put("Strike a key to move on...") ;
  1404.      st.update_line ;
  1405.      st.get( data, last, keys2 ) ;
  1406.      st.new_line(3) ;
  1407.      st.put("   This test will cover the following functionalities of the") ;
  1408.      st.new_line ;
  1409.      st.put("scroll terminal(the section of the Test document is included.)") ;
  1410.      st.new_line(2) ;
  1411.      st.put("writing data to the screen( 3.3.3.6 ),") ;
  1412.      st.new_line ;
  1413.      st.put("moving to a new_line( 3.3.3.4 )," ) ;
  1414.      st.new_line ;
  1415.      st.put("setting tab stops( 3.3.3.1 )," ) ;
  1416.      st.new_line ;
  1417.      st.put("moving by tab stops( 3.3.3.2 )," ) ;
  1418.      st.new_line ;
  1419.      st.put("moving to a new_page( 3.3.3.5 ),and ") ;
  1420.      st.new_line ;
  1421.      st.put("ringing the terminal's bell( 3.3.3.8 ).") ;
  1422.      st.new_line(2) ;
  1423.      st.put("Strike a key to continue...") ;
  1424.      st.update_line ;
  1425.      st.get( data, last, keys2 ) ;
  1426.  
  1427.      st.new_line(2) ;
  1428.  
  1429.      st.put("Strike a key to move to a new page( if supported ).") ;
  1430.      st.new_line ;
  1431.  
  1432.      st.get( data, last, keys2 ) ;
  1433.      st.new_page ;
  1434.  
  1435.      st.put("Strike a key and the terminal's bell will ring.") ;
  1436.      st.update_line ;
  1437.  
  1438.      st.get( data, last, keys2 ) ;
  1439.      st.bell ; st.bell ; st.bell ;
  1440.  
  1441.      st.new_line(2) ;
  1442.      st.put("Let's set some tab stops on the line and call Tab(3)") ;
  1443.      st.new_line ;
  1444.      st.put("and see what happens.") ;
  1445.      st.new_line(2) ;
  1446.      st.put("Tabs will be set where the 'X's appear on the following line");
  1447.      st.new_line(2) ;
  1448.      st.set_position(5) ;
  1449.      st.set_tab ;
  1450.      st.put('X') ;
  1451.      st.set_position(15);
  1452.      st.set_tab ;
  1453.      st.put('X') ;
  1454.      st.set_position(25);
  1455.      st.set_tab ;
  1456.      st.put('X') ;
  1457.  
  1458.      st.new_line(2) ;
  1459.      st.put("Now a call on new_line(2) followed by tab(3) then put('X') ");
  1460.      st.new_line ;
  1461.      st.put("will produce an 'X' to be written on the display.");
  1462.      st.new_line(2) ;
  1463.  
  1464.      st.put("Strike a key to see the results...") ;
  1465.      st.update_line ;
  1466.      st.get( data, last, keys2 ) ;
  1467.  
  1468.      st.new_line(2) ;
  1469.      st.tab(3) ;
  1470.      st.put('X') ;
  1471.      st.new_line(2) ;
  1472.      st.put("It should be under the third 'X' above.") ;
  1473.      st.new_line(2);
  1474.      st.put("Strike a key to continue...");
  1475.      st.update_line ;
  1476.      st.get( data, last, keys2 ) ;
  1477.  
  1478.      st.new_line(3) ;
  1479.      st.put("   This test will cover the following functionalities of the") ;
  1480.      st.new_line ;
  1481.      st.put("scroll terminal(the section of the Test document is included.)") ;
  1482.      st.new_line(2) ;
  1483.      st.put("writing data to the screen( 3.3.3.6 ),") ;
  1484.      st.new_line ;
  1485.      st.put("moving to a new_line( 3.3.3.4 ),and " ) ;
  1486.      st.new_line ;
  1487.      st.put("getting data from the keyboard( 3.3.3.7 )," ) ;
  1488.      st.new_line ;
  1489.      st.new_line ;
  1490.      st.put("Strike a key to continue...") ;
  1491.      st.update_line ;
  1492.      st.get( data, last, keys2 ) ;
  1493.      st.new_line ;
  1494.      st.put("Let's try putting a line past the end of the screen.") ;
  1495.      st.new_line ;
  1496.      st.put("Any data written past the width of the screen will be lost,and") ;
  1497.      st.new_line ;
  1498.    st.put("the cursor will be located in the rightmost column of the screen.");
  1499.      st.new_line ;
  1500.      st.new_line ;
  1501.      st.put("Strike a key to see the results then another key to move on...") ;
  1502.      st.new_line ;
  1503.      st.get( data, last, keys2 ) ;
  1504.  
  1505.      st.set_position( 50) ;
  1506.      st.put("This line should be chopped off and the rest is lost") ;
  1507.      st.update_line ;
  1508.  
  1509.      st.get( data, last, keys2 ) ;
  1510.  
  1511.      st.new_line( 2 ) ;
  1512.      st.put("Now let's test the reading from the keyboard functionality.");
  1513.      st.new_line(2) ;
  1514.      st.put("What you type at the keyboard will be read and put back on the ");
  1515.      st.new_line ;
  1516.      st.put("screen.  Type a '#' to exit.") ;
  1517.      st.new_line ;
  1518.      st.put("Strike a key to read data...") ;
  1519.      st.new_line(2) ;
  1520.  
  1521.  
  1522.      LOOP
  1523.         st.get( data, last, keys2 ) ;
  1524.  
  1525.         num_function_keys := st.function_count( keys2 ) ;
  1526.         IF last = 0
  1527.         THEN
  1528.             IF  num_function_keys = 0
  1529.             THEN
  1530.                 NULL ;
  1531.             ELSE
  1532.                 FOR i IN 1..num_function_keys
  1533.                 LOOP
  1534.                    st.function_key( keys2, i, key_id, prev_pos ) ;
  1535.                    st.function_key_name( key_id, key_name, key_last ) ;
  1536.                    st.put( right_arrow ) ;
  1537.                    st.put( key_name(1..key_last) ) ;
  1538.                    st.put( left_arrow ) ;
  1539.                 END LOOP ;
  1540.             END IF ;
  1541.         ELSE
  1542.             IF num_function_keys = 0
  1543.             THEN
  1544.                st.put( data( 1..last ) ) ;
  1545.  
  1546.             ELSE
  1547.                last_position := 1 ;
  1548.                FOR i IN 1..num_function_keys
  1549.                LOOP
  1550.                   st.function_key(keys2, i, key_id, prev_pos )  ;
  1551.                   IF prev_pos /= 0
  1552.                   THEN
  1553.                       st.put( data(last_position..prev_pos) ) ;
  1554.                       last_position := prev_pos + 1 ;
  1555.  
  1556.                   END IF ;
  1557.                   st.function_key_name( key_id, key_name, key_last ) ;
  1558.                   st.put(right_arrow);
  1559.                   st.put( key_name(1..key_last) ) ;
  1560.                   st.put(left_arrow);
  1561.                END LOOP ;
  1562.  
  1563.                IF last_position <= last
  1564.                THEN
  1565.                    st.put( data( last_position..last ) ) ;
  1566.                END IF ;
  1567.  
  1568.            END IF ;
  1569.         END IF ;
  1570.         st.update_line ;
  1571.  
  1572.         IF last /= 0
  1573.         THEN
  1574.            EXIT WHEN data(last) = '#' ;
  1575.         END IF ;
  1576.  
  1577.      END LOOP ;
  1578.  
  1579.      st.close ;
  1580.  
  1581. --
  1582. --
  1583. -- Abstract :   The following section of this test file will fully test
  1584. --              the requirements as proposed by the Specification document.
  1585. --
  1586. --              The person performing the test might follow along in the
  1587. --              Specification document to verify the correctness of each
  1588. --              of the functionalities being tested.
  1589. --
  1590. --
  1591. -- This Ada program produces the introduction for the form terminal
  1592. --  testing to be done by the user.
  1593. --
  1594.   VT.OPEN ;
  1595.  
  1596.   VT.SET_POSITION( VT.XY_POSITION'(10, 18) ) ;
  1597.   VT.SELECT_GRAPHIC_RENDITION( VT.REVERSE_IMAGE ) ;
  1598.  
  1599.   VT.PUT("  INTERACTIVE TEST FOR THE FORM MODE TERMINAL  ") ;
  1600.   VT.SET_POSITION( VT.XY_POSITION'(12, 29) ) ;
  1601.   VT.PUT("  OF THE VIRTUAL TERMINAL  ") ;
  1602.  
  1603.   VT.SET_POSITION( VT.XY_POSITION'(24, 50) ) ;
  1604.   VT.SELECT_GRAPHIC_RENDITION( VT.PRIMARY_RENDITION ) ;
  1605.  
  1606.   VT.PUT("...strike any key to continue." ) ;
  1607.   vt.update_screen(1, vt_content.height ) ;
  1608.   VT.GET( IN_BUFFER, IN_BUFFER_LEN, KEYS ) ;
  1609.  
  1610.   vt.erase_in_display( vt.all_positions ) ;
  1611.   vt.update_screen(1, vt_content.height ) ;
  1612.  
  1613.   VT.CLOSE ;
  1614.  
  1615. --
  1616. -- testing define_qualified_area, writing data on the screen,
  1617. -- and activating a form for user fill in
  1618. --
  1619.       form.open ;
  1620.  
  1621.       form.set_position( form.xy_position'(5, 20) ) ;
  1622.       form.put("Tests for define_qualified_area, put, and activate_") ;
  1623.       form.set_position( form.xy_position'(6, 15) ) ;
  1624.       form.put("form  for the form_terminal, refer to sections");
  1625.       form.set_position( form.xy_position'(7, 15) ) ;
  1626.       form.put("3.3.3.24, 3.3.3.29, and 3.3.3.30 of the Test ") ;
  1627.       form.set_position( form.xy_position'(8, 15) ) ;
  1628.       form.put("Procedures document.") ;
  1629.       form.set_position( form.xy_position'(20, 30) ) ;
  1630.       form.put("...strike a function key to continue") ;
  1631.       form.activate_form ;
  1632.       form.erase_display ;
  1633.  
  1634.       form.set_position( form.xy_position'(5,18) ) ;
  1635.       form.define_qualified_area( intensity => form.normal,
  1636.                                   protection => form.protected
  1637.                                   ) ;
  1638.       form.put("Enter name:"); -- act. pos. still at 5,17
  1639.  
  1640.       form.set_position( form.xy_position'(6,14) ) ;
  1641.       form.define_qualified_area( intensity => form.normal,
  1642.                                   protection => form.protected
  1643.                                   ) ;
  1644.       form.put("Enter password:") ;
  1645.  
  1646.       form.set_position( form.xy_position'(5,29) ) ;
  1647.       form.define_qualified_area( intensity => form.high ,
  1648.                                   protection => form.unprotected,
  1649.                                   input => form.graphic_characters);
  1650.  
  1651.       form.set_position( form.xy_position'(5,59) ) ;
  1652.       form.define_qualified_area( intensity => form.normal,
  1653.                                   protection => form.protected ) ;
  1654.  
  1655.       form.set_position( form.xy_position'(6,29) ) ;
  1656.       form.define_qualified_area( intensity => form.none ,
  1657.                                   protection => form.unprotected,
  1658.                                   input => form.graphic_characters);
  1659.  
  1660.       form.set_position( form.xy_position'(6,40) ) ;
  1661.       form.define_qualified_area( intensity => form.normal,
  1662.                                   protection => form.protected ) ;
  1663.  
  1664.       form.set_position( form.xy_position'(9,1) ) ;
  1665.       form.define_qualified_area( intensity => form.normal,
  1666.                                   protection => form.protected ) ;
  1667.  
  1668.       form.set_position( form.xy_position'(11,15) ) ;
  1669.       form.put("This form has five qualified areas defined on it,") ;
  1670.       form.set_position( form.xy_position'(12,10) ) ;
  1671.       form.put("two of which are unprotected, this means that once the");
  1672.       form.set_position( form.xy_position'(13,10) ) ;
  1673.       form.put("form is activated, only those two areas may accept input.");
  1674.  
  1675.       form.set_position( form.xy_position'(15,10)) ;
  1676.       form.put("The form is now active until a function key is pressed.");
  1677.       form.set_position( form.xy_position'(16,10)) ;
  1678.       form.put("Try entering values into the unprotected areas and other");
  1679.       form.set_position( form.xy_position'(17,10)) ;
  1680.       form.put("areas if you like. The first unprotected area accepts");
  1681.       form.set_position( form.xy_position'(18,10)) ;
  1682.       form.put("graphic characters and the second has no rendition.") ;
  1683.       form.set_position( form.xy_position'(19,10)) ;
  1684.       form.put("Type in a password of ten characters or less. We will use");
  1685.       form.set_position( form.xy_position'(20,10)) ;
  1686.       form.put("the 'reading from the form' functionality to extract ") ;
  1687.       form.set_position( form.xy_position'(21,10)) ;
  1688.       form.put("the password and display it to you.") ;
  1689.       form.set_position( form.xy_position'(23,10)) ;
  1690.       form.put("Strike a function key to show your password.") ;
  1691.       form.activate_form ;
  1692.  
  1693.       form.set_position( form.xy_position'(9, 1) ) ;
  1694.       form.erase_area ;
  1695.  
  1696.       form.set_position( form.xy_position'(16,10) ) ;
  1697.       form.put("Strike a function key to move on...and we'll retrieve ");
  1698.       form.set_position( form.xy_position'(17,10) ) ;
  1699.       form.put("the function key you hit and display it to you.") ;
  1700.  
  1701.       form.set_position( form.xy_position'(6,30) ) ;
  1702.       form.get( buffer ) ;
  1703.       form.set_position( form.xy_position'(13,10) ) ;
  1704.       form.put("Your password is =>> ") ;
  1705.       form.set_position( form.xy_position'(13,30) ) ;
  1706.       form.define_qualified_area( intensity => form.high ,
  1707.                                   protection => form.protected ) ;
  1708.  
  1709.       form.set_position( form.xy_position'(13,41) ) ;
  1710.       form.define_qualified_area( intensity => form.normal,
  1711.                                   protection => form.protected ) ;
  1712.  
  1713.       form.set_position( form.xy_position'(13, 31) ) ;
  1714.       form.put( buffer ) ;
  1715.  
  1716.       form.set_position( form.xy_position'(20,10) ) ;
  1717.       form.put("The function key you struck is =>> ") ;
  1718.  
  1719.       form.activate_form ;
  1720.  
  1721.       value := form.termination_key ;
  1722.       driver.interpret( ascii.esc & "[20;47H" ) ;
  1723.       int_io.put( value ) ;
  1724.  
  1725.  
  1726.      delay 3.0 ;  -- wait a couple of seconds.....
  1727.  
  1728.     form.erase_display ;
  1729.     form.set_position( form.xy_position'(5, 20) ) ;
  1730.     form.put("Tests for define_qualified_area, put, moving by") ;
  1731.     form.set_position( form.xy_position'(6, 15 ) ) ;
  1732.     form.put("tab stops, erasing areas on the display, ") ;
  1733.     form.set_position( form.xy_position'(7, 15 ) ) ;
  1734.     form.put("reading characters from the display, clearing ") ;
  1735.     form.set_position( form.xy_position'(8, 15 ) ) ;
  1736.     form.put("qualified areas, and activating a form for user ")  ;
  1737.     form.set_position( form.xy_position'(9, 15) ) ;
  1738.     form.put("fill in for the form_terminal, refer to sections");
  1739.     form.set_position( form.xy_position'(10, 15) ) ;
  1740.     form.put("3.3.3.24 thru 3.3.3.30 of the Test Procedures document.") ;
  1741.     form.set_position( form.xy_position'(20, 30) ) ;
  1742.     form.put("...strike a function key to continue") ;
  1743.     form.activate_form ;
  1744.     form.erase_display ;
  1745.  
  1746.     create_form1;
  1747.     form.activate_form;
  1748.  
  1749.     modify_form1 ;
  1750.     form.activate_form;
  1751.     create_form2 ;
  1752.     form.activate_form ;
  1753.  
  1754.     form.close;
  1755.  
  1756.     vt.open ;
  1757.     vt.erase_in_display( vt.all_positions ) ;
  1758.     vt.update_screen( 1, vt_content.height ) ;
  1759.     vt.close ;
  1760.  
  1761. END vt_test ;
  1762. PRAGMA main;
  1763.