home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / turbo_c / reslb201.arc / TEST.C < prev   
Text File  |  1987-10-31  |  2KB  |  57 lines

  1. #include <resident.h> 
  2.  
  3. int window_one_buff [ (37 + 2) * (4 + 2) ]; 
  4. int run_once = 0, low_color = MONOCHROME, hi_color; 
  5. int pass_buffer [ 35 * 2 + 1 ]; 
  6.  
  7. struct WINDOW window_one; 
  8.  
  9. void test_box () 
  10.    { 
  11.       int key; 
  12.  
  13.       if (run_once)  
  14.          exch_window (&window_one); 
  15.       else { 
  16.          make_window (&window_one); 
  17.          dis_str (11, 21, "Test of Memory Resident Library V2.01", low_color); 
  18.          dis_str (12, 21, "Press the arrow & paging keys to move", low_color); 
  19.          dis_str (13, 21, "Press ESC to uninstall the test Prog.", low_color); 
  20.          dis_str (14, 25,     "Press any other key to exit.", low_color); 
  21.          run_once = 1; 
  22.       } 
  23.       hidecur (); 
  24.       while (!(key = getch ())) 
  25.          key_window (getch (), &window_one);  
  26.       keystrokes ("Test Passed!", pass_buffer);  
  27.       exch_window (&window_one); 
  28.       normalcur (); 
  29.       if (key == 27) 
  30.          drop_tsr (); 
  31.    } 
  32.  
  33. main () 
  34.    { 
  35.       if (loaded ()) 
  36.          printf ("The test program has already been loaded"); 
  37.       else { 
  38.          if (iscolor ()) 
  39.             low_color = color (GREEN, BLACK); 
  40.          hi_color = 10; 
  41.          STACK_SIZE = 200; 
  42.          window_one.row = 10; 
  43.          window_one.col = 20; 
  44.          window_one.hlen = 37; 
  45.          window_one.vlen = 4; 
  46.          window_one.color = hi_color; 
  47.          window_one.buffer = window_one_buff; 
  48.          window_one.vtype = DOUBLE_LINE; 
  49.          window_one.htype = DOUBLE_LINE; 
  50.          printf ("\n"); 
  51.          printf ("Memory Resident Library V2.01 Test Program\n"); 
  52.          printf ("Press Ctrl - Alt - T to call up.\n"); 
  53.          go_resident (test_box, KEY_T, KEY_ALT, KEY_CTRL);  
  54.       } 
  55.    } 
  56.  
  57.