home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / flash-c1.zip / VIODEMO.C < prev    next >
Text File  |  1990-02-11  |  35KB  |  1,394 lines

  1. #include <fpclib.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5. #include <conio.h>
  6. #include <math.h>
  7.  
  8. typedef struct TCell {
  9.                      char Ch,Attr;
  10.                      } TCell;
  11.  
  12. void ClearTime( void );
  13. void Delay( int num );
  14. void str(int num, int digits, char *st );
  15. char UpCase( char ch );
  16. void DisplayTime( int NTimes );
  17. void TestBorderColor( void );
  18. void TestClrWin( void );
  19. void TestColorMsg( void );
  20. void TestEditSt( void );
  21. void TestFillColAttr( void );
  22. void TestFillColCell( void );
  23. void TestFillColChar( void );
  24. void TestFillFrameAttr( void );
  25. void TestFillFrameCell( void );
  26. void TestFillFrameChar( void );
  27. void TestFillRowAttr( void );
  28. void TestFillRowCell( void );
  29. void TestFillRowChar( void );
  30. void TestGetFrameAttr( void );
  31. void TestGetFrameCell( void );
  32. void TestGetFrameChar( void );
  33. void TestGetScrn( void );
  34. void TestPutScrn( void );
  35. void TestPutFrameAttr( void );
  36. void TestPutFrameCell( void );
  37. void TestPutFrameChar( void );
  38. void TestGetCursorSize( void );
  39. void TestFrameWin( void );
  40. void TestSetCursorSize( void );
  41. void TestRvsAttr( void );
  42. void TestGetVideoMode( void );
  43. void TestInitVideo( void );
  44. void TestGetVideoCols( void );
  45. void TestGetVideoPage( void );
  46. void TestGetVideoInfo( void );
  47. void TestSetVideoPage( void );
  48. void TestWhereXYAbs( void );
  49. void TestScrollLeft( void );
  50. void TestScrollRight( void );
  51. void TestScrollDown( void );
  52. void TestScrollUp( void );
  53. void TestWriteSt( void );
  54. void TestWriteStln( void );
  55. int  GetMenuSelection( void );
  56.  
  57.  
  58. char TCSet[32] = {  0,101,  0,0,0,0, 0,24,
  59.                    57,213,192,0,0,0,95, 0,
  60.                     8,  0,  0,0,0,0, 0, 0,
  61.                     0,  0,  0,0,0,0, 0, 0
  62.                  };
  63.  
  64. char VCSet[32] = {   0,  0,  0,  0,255,255,255,255,
  65.                    255,255,255,255,255,255,255,255,
  66.                    255,255,255,255,255,255,255,255,
  67.                    255,255,255,255,255,255,255,255
  68.                  };
  69.  
  70. int    i,j,i1,k,ChOfs,TE,
  71.        H1,M1,S1,Sec100_1,
  72.        H2,M2,S2,Sec100_2,
  73.        t1,t2,t3,Total;
  74.  
  75. char   St[256],Done;
  76.  
  77.  
  78. void ClearTime()
  79. {
  80.    H1 = M1 = S1 = Sec100_1 = 0;
  81.    H2 = M2 = S2 = Sec100_2 = 0;
  82.    Total = 0;
  83. }
  84.  
  85. void Delay(num)
  86. int num;
  87. {
  88.    int i;
  89.  
  90.    num *= 50;
  91.    for (i = 0; i <= num; i++)
  92.    ;
  93. }
  94.  
  95. void str(num,digits,st)
  96. char *st;
  97. int  num,digits;
  98. {
  99.    int i;
  100.  
  101.    *(st+digits) = '\0';
  102.    for (i = digits-1; i >= 0; i--) {
  103.       *(st+i) =  (num % 10) + 48;
  104.       num /= 10;
  105.    }
  106. }
  107.  
  108. char UpCase(ch)
  109. char ch;
  110. {
  111.    if (ch >= 'a' && ch <= 'z')
  112.       ch -= 32;
  113.    return(ch);
  114. }
  115.  
  116. void DisplayTime(NTimes)
  117. int  NTimes;
  118. {
  119.    char   st[80];
  120.  
  121.  
  122.    WindowFP(15,10,65,14);
  123.    ClrWin( 15, 10, 65, 14, 48 );
  124.    FrameWin('╔','╗','╚','╝','═','║',48);
  125.  
  126.    strcpy( st, "Total Time = " );
  127.    itoa( Total, &st[13], 10 );
  128.    ColorMsg( 17, 11, 48, st );
  129.  
  130.    strcpy( st, "NTimes     = " );
  131.    itoa( NTimes, &st[13], 10 );
  132.    ColorMsg( 17, 12, 48, st );
  133.  
  134.  
  135.    strcpy( st, "Average time = " );
  136.    itoa( Total / NTimes , &st[15], 10 );
  137.    strcat( st, " hundredths of a second" );
  138.    ColorMsg( 17, 13, 48, st );
  139.  
  140.    for (i = 0; i < 3; i++)
  141.       FillRowAttr(16,i+11,50,48);
  142.    ColorMsg(18,14,144," Press any key to continue... ");
  143.    GetKey();
  144. }
  145.  
  146. void TestBorderColor()
  147. {
  148.    int  i;
  149.  
  150.    if ( VioMode == 7 ) {
  151.       ClrWin(1,1,80,25,7);
  152.       WindowFP(21,11,60,14);
  153.       ClrWin(21,11,60,14,48);
  154.       FrameWin('╔','╗','╚','╝','═','║',48);
  155.       ColorMsg(23,12,48,"Not Available on Monochrome monitors");
  156.       ColorMsg(23,13,48,"    Press any key to continue...");
  157.       WindowFP(1,1,80,25);
  158.    }
  159.    else {
  160.       GotoxyAbs(1,1);
  161.       for (i = 1; i <= 15; i++) {
  162.          BorderColor(i);
  163.          WriteStln("Press any key to continue...");
  164.          GetKey();
  165.       }
  166.    }
  167.    GetKey();
  168.    BorderColor(0);
  169. }
  170.  
  171. void TestClrWin()
  172. {
  173.    int    Color,TopRow,BottomRow,LeftCol,RightCol;
  174.  
  175.    ClrWin(1,1,80,25,7);
  176.    GotoxyAbs(1,1);
  177.    printf("\nEnter attribute value to clear screen with. 0-255 ==> ");
  178.    scanf("%d",&Color);
  179.    printf("\nEnter top row of area to clear. 1-25 ==> ");
  180.    scanf("%d",&TopRow);
  181.    printf("\nEnter left column of area to clear. 1-80 ==> ");
  182.    scanf("%d",&LeftCol);
  183.    printf("\nEnter bottom row of area to clear. %u-25 ==> ",TopRow);
  184.    scanf("%d",&BottomRow);
  185.    printf("\nEnter right column of area to clear. %u-80 ==> ",LeftCol);
  186.    scanf("%d",&RightCol);
  187.  
  188.    FillRowCell(1,1,2000,(65 << 8) + 7);
  189.    ColorMsg(1,1,48,"Press any key to clear area");
  190.    GetKey();
  191.    ClrWin(LeftCol,TopRow,RightCol,BottomRow,Color);
  192.    ColorMsg(1,1,48,"Press any key to return to menu");
  193.    GetKey();
  194. }
  195.  
  196. void TestColorMsg()
  197. {
  198.    char Msg[256];
  199.    int  i,Color,Char_Ofs = 1,TE = 0;
  200.  
  201.    TextAttr = 7;
  202.    do {
  203.       ClrWin(1,1,80,25,7);
  204.       GotoxyAbs(1,1);
  205.       WindowFP(10,1,69,3);
  206.       FrameWin('╔','╗','╚','╝','═','║',TextAttr);
  207.       ColorMsg(12,2,TextAttr,
  208.                "Enter 'QUIT' for message when you want to quit this test");
  209.       WindowFP(1,4,60,7);
  210.       FrameWin('╔','╗','╚','╝','═','║',TextAttr);
  211.       ColorMsg(3,4,TextAttr," ColorMsg data ");
  212.       ColorMsg(3,5,TextAttr,"Enter message to display ==> ");
  213.       for (i = 0; i < 255; Msg[i++] = '\0')
  214.       ;
  215.       EditSt(5,32,59,28,0,32,0,7000,2000,VCSet,TCSet,&Char_Ofs,&TE,Msg);
  216.       ColorMsg(3,6,TextAttr,"Enter the color to display message in ==> ");
  217.       GotoxyAbs(44,6);
  218.       scanf("%d",&Color);
  219.  
  220.       WindowFP(1,10,50,14);
  221.       FrameWin('╔','╗','╚','╝','═','║',TextAttr);
  222.  
  223.       ColorMsg(3,11,Color,Msg);
  224.       RvsAttr(TextAttr);
  225.       ColorMsg(2,13,TextAttr,
  226.                "          Press any key to continue...          ");
  227.       RvsAttr(TextAttr);
  228.       GetKey();
  229.       for (Color = 0; Color < 4; Color++)
  230.          if (Msg[Color] >= 'a' && Msg[Color] <= 'z')
  231.             Msg[Color] -= 32;
  232.  
  233.    } while (strcmp(Msg,"QUIT"));
  234. }
  235.  
  236. void TestEditSt()
  237. {
  238.    char  St[256];
  239.    int   i,Char_Ofs,TE;
  240.  
  241.    ClrWin(1,1,80,25,7);
  242.    ColorMsg(1,10,7,"Enter your name:");
  243.    for (i = 0; i <= 255; St[i++] = '\0')
  244.    ;
  245.    Char_Ofs = 1;
  246.    TE       = 0;
  247.    EditSt(10,18,28,30,1,7,0,7000,2000,VCSet,TCSet,&Char_Ofs,&TE,St);
  248.    RvsAttr(TextAttr);
  249.    GotoxyAbs(1,15);
  250.    WriteSt(St);
  251.    RvsAttr(TextAttr);
  252.    GetKey();
  253. }
  254.  
  255. void TestFillColAttr()
  256. {
  257.    int   i,NTimes = 80;
  258.  
  259.    ClrWin(1,1,80,25,7);
  260.    ClearTime();
  261.    for (i = 1; i <= NTimes; i++) {
  262.  
  263.       GetTime(&H1,&M1,&S1,&Sec100_1);
  264.       FillColAttr(i,1,25,i*16);
  265.       GetTime(&H2,&M2,&S2,&Sec100_2);
  266.  
  267.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  268.          Total = Total + (Sec100_2 - Sec100_1);
  269.       else {
  270.          t1 = 100 - Sec100_1 + Sec100_2;
  271.          Total = Total + t1;
  272.       };
  273.    };
  274.    DisplayTime(NTimes);
  275. }
  276.  
  277. void TestFillColCell()
  278. {
  279.    int i,
  280.        NTimes = 80;
  281.  
  282.    ClrWin(1,1,80,25,7);
  283.    ClearTime();
  284.    for (i = 1; i <= NTimes; i++) {
  285.  
  286.       GetTime(&H1,&M1,&S1,&Sec100_1);
  287.       FillColCell(i,1,25,((i+64) << 8) + i);
  288.       GetTime(&H2,&M2,&S2,&Sec100_2);
  289.  
  290.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  291.          Total = Total + (Sec100_2 - Sec100_1);
  292.       else {
  293.          t1 = 100 - Sec100_1 + Sec100_2;
  294.          Total = Total + t1;
  295.       };
  296.    };
  297.    DisplayTime(NTimes);
  298. }
  299.  
  300. void TestFillColChar()
  301. {
  302.    int i,
  303.        NTimes = 80;
  304.  
  305.    ClrWin(1,1,80,25,7);
  306.    ClearTime();
  307.    for (i = 1; i <= NTimes; i++) {
  308.  
  309.       GetTime(&H1,&M1,&S1,&Sec100_1);
  310.       FillColChar(i,1,25,i+64);
  311.       GetTime(&H2,&M2,&S2,&Sec100_2);
  312.  
  313.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  314.          Total = Total + (Sec100_2 - Sec100_1);
  315.       else {
  316.          t1 = 100 - Sec100_1 + Sec100_2;
  317.          Total = Total + t1;
  318.       };
  319.    };
  320.    DisplayTime(NTimes);
  321. }
  322.  
  323. void TestFillFrameAttr()
  324. {
  325.    int i,
  326.        NTimes = 15;
  327.  
  328.    ClrWin(1,1,80,25,7);
  329.    ClearTime();
  330.    for (i = 1; i <= NTimes; i++) {
  331.  
  332.       GetTime(&H1,&M1,&S1,&Sec100_1);
  333.       FillFrameAttr(1,1,80,25,i << 4);
  334.       GetTime(&H2,&M2,&S2,&Sec100_2);
  335.  
  336.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  337.          Total = Total + (Sec100_2 - Sec100_1);
  338.       else {
  339.          t1 = 100 - Sec100_1 + Sec100_2;
  340.          Total = Total + t1;
  341.       };
  342.    };
  343.    DisplayTime(NTimes);
  344. }
  345.  
  346. void TestFillFrameCell()
  347. {
  348.    int i,
  349.        NTimes = 15;
  350.  
  351.    ClrWin(1,1,80,25,7);
  352.    ClearTime();
  353.    for (i = 1; i <= NTimes; i++) {
  354.  
  355.       GetTime(&H1,&M1,&S1,&Sec100_1);
  356.       FillFrameCell(1,1,80,25,((i+64) << 8) + i);
  357.       GetTime(&H2,&M2,&S2,&Sec100_2);
  358.  
  359.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  360.          Total = Total + (Sec100_2 - Sec100_1);
  361.       else {
  362.          t1 = 100 - Sec100_1 + Sec100_2;
  363.          Total = Total + t1;
  364.       };
  365.    };
  366.    DisplayTime(NTimes);
  367. }
  368.  
  369. void TestFillFrameChar()
  370. {
  371.    int i,
  372.        NTimes = 15;
  373.  
  374.    ClrWin(1,1,80,25,7);
  375.    ClearTime();
  376.    for (i = 1; i <= NTimes; i++) {
  377.  
  378.       GetTime(&H1,&M1,&S1,&Sec100_1);
  379.       FillFrameChar(1,1,80,25,(i+64));
  380.       GetTime(&H2,&M2,&S2,&Sec100_2);
  381.  
  382.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  383.          Total = Total + (Sec100_2 - Sec100_1);
  384.       else {
  385.          t1 = 100 - Sec100_1 + Sec100_2;
  386.          Total = Total + t1;
  387.       };
  388.    };
  389.    DisplayTime(NTimes);
  390. }
  391.  
  392. void TestFillRowAttr()
  393. {
  394.    int i,NTimes = 15;
  395.  
  396.    ClrWin(1,1,80,25,7);
  397.    ClearTime();
  398.    for (i = 1; i <= NTimes; i++) {
  399.  
  400.       GetTime(&H1,&M1,&S1,&Sec100_1);
  401.       FillRowAttr(1,1,2000,i*16);
  402.       GetTime(&H2,&M2,&S2,&Sec100_2);
  403.  
  404.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  405.          Total = Total + (Sec100_2 - Sec100_1);
  406.       else {
  407.          t1 = 100 - Sec100_1 + Sec100_2;
  408.          Total = Total + t1;
  409.       };
  410.    };
  411.    DisplayTime(NTimes);
  412. }
  413.  
  414. void TestFillRowCell()
  415. {
  416.    int  i,NTimes = 15;
  417.  
  418.    ClrWin(1,1,80,25,7);
  419.    ClearTime();
  420.    for (i = 1; i <= NTimes; i++) {
  421.  
  422.       GetTime(&H1,&M1,&S1,&Sec100_1);
  423.       FillRowCell(1,1,2000,((64+i) << 8) + i);
  424.       GetTime(&H2,&M2,&S2,&Sec100_2);
  425.  
  426.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  427.          Total = Total + (Sec100_2 - Sec100_1);
  428.       else {
  429.          t1 = 100 - Sec100_1 + Sec100_2;
  430.          Total = Total + t1;
  431.       };
  432.    };
  433.    DisplayTime(NTimes);
  434. }
  435.  
  436. void TestFillRowChar()
  437. {
  438.    int  i,NTimes = 15;
  439.  
  440.    ClrWin(1,1,80,25,7);
  441.    ClearTime();
  442.    for (i = 1; i <= NTimes; i++) {
  443.  
  444.       GetTime(&H1,&M1,&S1,&Sec100_1);
  445.       FillRowChar(1,1,2000,(i+64));
  446.       GetTime(&H2,&M2,&S2,&Sec100_2);
  447.  
  448.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  449.          Total = Total + (Sec100_2 - Sec100_1);
  450.       else {
  451.          t1 = 100 - Sec100_1 + Sec100_2;
  452.          Total = Total + t1;
  453.       };
  454.    };
  455.    DisplayTime(NTimes);
  456. }
  457.  
  458. void TestGetFrameAttr()
  459. {
  460.    int  i,NTimes = 15;
  461.    char Buffer[26][80];
  462.  
  463.    ClrWin(1,1,80,25,7);
  464.    ClearTime();
  465.    for (i = 1; i <= NTimes; i++) {
  466.  
  467.       FillRowCell(1,1,2000,((i+64) << 8) + i*16);
  468.  
  469.       GetTime(&H1,&M1,&S1,&Sec100_1);
  470.       GetFrameAttr(1,1,80,25,Buffer[0]);
  471.       GetTime(&H2,&M2,&S2,&Sec100_2);
  472.  
  473.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  474.          Total = Total + (Sec100_2 - Sec100_1);
  475.       else {
  476.          t1 = 100 - Sec100_1 + Sec100_2;
  477.          Total = Total + t1;
  478.       };
  479.    };
  480.    DisplayTime(NTimes);
  481. }
  482.  
  483. void TestGetFrameCell()
  484. {
  485.    int  i,NTimes = 15;
  486.    char Buffer[25][160];
  487.  
  488.    ClrWin(1,1,80,25,7);
  489.    ClearTime();
  490.    for (i = 1; i <= NTimes; i++) {
  491.       FillRowCell(1,1,2000,((i+64) << 8) + i*16);
  492.  
  493.       GetTime(&H1,&M1,&S1,&Sec100_1);
  494.       GetFrameCell(1,1,80,25,Buffer[0]);
  495.       GetTime(&H2,&M2,&S2,&Sec100_2);
  496.  
  497.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  498.          Total = Total + (Sec100_2 - Sec100_1);
  499.       else {
  500.          t1 = 100 - Sec100_1 + Sec100_2;
  501.          Total = Total + t1;
  502.       };
  503.    };
  504.    DisplayTime(NTimes);
  505. }
  506.  
  507. void TestGetFrameChar()
  508. {
  509.    int  i,NTimes = 15;
  510.    char Buffer[25][80];
  511.  
  512.    ClrWin(1,1,80,25,7);
  513.    ClearTime();
  514.    for (i = 1; i <= NTimes; i++) {
  515.       FillRowCell(1,1,2000,((i+64) << 8) + i*16);
  516.  
  517.       GetTime(&H1,&M1,&S1,&Sec100_1);
  518.       GetFrameChar(1,1,80,25,Buffer[0]);
  519.       GetTime(&H2,&M2,&S2,&Sec100_2);
  520.  
  521.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  522.          Total = Total + (Sec100_2 - Sec100_1);
  523.       else {
  524.          t1 = 100 - Sec100_1 + Sec100_2;
  525.          Total = Total + t1;
  526.       };
  527.    };
  528.    DisplayTime(NTimes);
  529. }
  530.  
  531. void TestGetScrn()
  532. {
  533.    int  i,NTimes = 30;
  534.    char Buffer[25][160];
  535.  
  536.    ClrWin(1,1,80,25,7);
  537.    ClearTime();
  538.    for (i = 1; i <= NTimes; i++) {
  539.  
  540.       FillRowChar(1,1,2000,(i+64));
  541.       GetTime(&H1,&M1,&S1,&Sec100_1);
  542.       GetScrn(1,1,2000,Buffer[0]);
  543.       GetTime(&H2,&M2,&S2,&Sec100_2);
  544.  
  545.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  546.          Total = Total + (Sec100_2 - Sec100_1);
  547.       else {
  548.          t1 = 100 - Sec100_1 + Sec100_2;
  549.          Total = Total + t1;
  550.       };
  551.    };
  552.    DisplayTime(NTimes);
  553.  
  554. }
  555.  
  556. void TestPutScrn()
  557. {
  558.    int  i,NTimes = 30;
  559.    char Buffer[25][160];
  560.  
  561.    ClrWin(1,1,80,25,7);
  562.    ClearTime();
  563.    for (i = 1; i <= NTimes; i++) {
  564.  
  565.       FillRowChar(1,1,2000,(i+64));
  566.       GetScrn(1,1,2000,Buffer[0]);
  567.       FillRowChar(1,1,2000,0);
  568.  
  569.       GetTime(&H1,&M1,&S1,&Sec100_1);
  570.       PutScrn(1,1,2000,Buffer[0]);
  571.       GetTime(&H2,&M2,&S2,&Sec100_2);
  572.  
  573.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  574.          Total = Total + (Sec100_2 - Sec100_1);
  575.       else {
  576.          t1 = 100 - Sec100_1 + Sec100_2;
  577.          Total = Total + t1;
  578.       };
  579.    };
  580.    DisplayTime(NTimes);
  581. }
  582.  
  583. void TestPutFrameAttr()
  584. {
  585.    int  i,NTimes = 15;
  586.    char Buffer[25][80];
  587.  
  588.    ClrWin(1,1,80,25,7);
  589.    ClearTime();
  590.    for (i = 1; i <= NTimes; i++) {
  591.       FillRowCell(1,1,2000,((i+64) << 8) + i*16);
  592.       GetFrameAttr(1,1,80,25,Buffer[0]);
  593.       ClrWin(1,1,80,25,7);
  594.  
  595.       GetTime(&H1,&M1,&S1,&Sec100_1);
  596.       PutFrameAttr(1,1,80,25,Buffer[0]);
  597.       GetTime(&H2,&M2,&S2,&Sec100_2);
  598.  
  599.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  600.          Total = Total + (Sec100_2 - Sec100_1);
  601.       else {
  602.          t1 = 100 - Sec100_1 + Sec100_2;
  603.          Total = Total + t1;
  604.       };
  605.    };
  606.    DisplayTime(NTimes);
  607. }
  608.  
  609. void TestPutFrameCell()
  610. {
  611.    int  i,NTimes = 15;
  612.    char Buffer[25][160];
  613.  
  614.    ClrWin(1,1,80,25,7);
  615.    ClearTime();
  616.    for (i = 1; i <= NTimes; i++) {
  617.       FillRowCell(1,1,2000,((i+64) << 8) + i);
  618.       GetFrameCell(1,1,80,25,Buffer[0]);
  619.  
  620.       GetTime(&H1,&M1,&S1,&Sec100_1);
  621.       PutFrameCell(1,1,80,25,Buffer[0]);
  622.       GetTime(&H2,&M2,&S2,&Sec100_2);
  623.  
  624.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  625.          Total = Total + (Sec100_2 - Sec100_1);
  626.       else {
  627.          t1 = 100 - Sec100_1 + Sec100_2;
  628.          Total = Total + t1;
  629.       };
  630.    };
  631.    DisplayTime(NTimes);
  632. }
  633.  
  634. void TestPutFrameChar()
  635. {
  636.    int  i,NTimes = 15;
  637.    char Buffer[25][80];
  638.  
  639.    ClrWin(1,1,80,25,7);
  640.    ClearTime();
  641.    for (i = 1; i <= NTimes; i++) {
  642.       FillRowCell(1,1,2000,((i+64) << 8) + i*16);
  643.       GetFrameChar(1,1,80,25,Buffer[0]);
  644.       ClrWin(1,1,80,25,7);
  645.  
  646.       GetTime(&H1,&M1,&S1,&Sec100_1);
  647.       PutFrameChar(1,1,80,25,Buffer[0]);
  648.       GetTime(&H2,&M2,&S2,&Sec100_2);
  649.  
  650.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  651.          Total = Total + (Sec100_2 - Sec100_1);
  652.       else {
  653.          t1 = 100 - Sec100_1 + Sec100_2;
  654.          Total = Total + t1;
  655.       };
  656.    };
  657.    DisplayTime(NTimes);
  658. }
  659.  
  660. void TestGetCursorSize()
  661. {
  662.    char St1[256],St2[256];
  663.    int  size;
  664.  
  665.    ClrWin(1,1,80,25,7);
  666.    WindowFP(24,10,55,14);
  667.    ClrWin(24,10,55,14,48);
  668.    FrameWin('╔','╗','╚','╝','═','║',48);
  669.    GotoxyAbs(1,1);
  670.    ColorMsg(26,10,48," GetCursorSize ");
  671.    size = GetCursorSize();
  672.  
  673.    itoa(size & 0xff,St2,10);
  674.    strcpy(St1," Starting scan line = ");
  675.    strcat(St1,St2);
  676.    ColorMsg(25,11,48,St1);
  677.  
  678.    itoa(size >> 8,St2,10);
  679.    strcpy(St1," Ending scan line   = ");
  680.    strcat(St1,St2);
  681.    ColorMsg(25,12,48,St1);
  682.  
  683.    ColorMsg(25,14,144," Press any key to continue... ");
  684.    GetKey();
  685.    WindowFP(1,1,80,25);
  686. }
  687.  
  688. void TestFrameWin()
  689. {
  690.    int    i,NTimes = 10,t1 = 0;
  691.  
  692.    ClrWin(1,1,80,25,7);
  693.    ClearTime();
  694.    WindowFP(1,1,80,25);
  695.    for (i = 1; i <= NTimes; i++) {
  696.  
  697.       GetTime(&H1,&M1,&S1,&Sec100_1);
  698.       FrameWin('┌','┐','└','┘','─','│',7);
  699.       GetTime(&H2,&M2,&S2,&Sec100_2);
  700.  
  701.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  702.          Total = Total + (Sec100_2 - Sec100_1);
  703.       else {
  704.          t1 = 100 - Sec100_1 + Sec100_2;
  705.          Total = Total + t1;
  706.       };
  707.    };
  708.    DisplayTime(NTimes);
  709. }
  710.  
  711. void TestSetCursorSize()
  712. {
  713.    int    StScan,SpScan;
  714.  
  715.    ClrWin(1,1,80,25,7);
  716.    WindowFP(24,10,58,14);
  717.    ClrWin(24,10,58,14,48);
  718.    FrameWin('╔','╗','╚','╝','═','║',48);
  719.    GotoxyAbs(1,1);
  720.    ColorMsg(26,10,48," GetCursorSize ");
  721.  
  722.    ColorMsg(26,11,48,"Enter Starting scan line ==> ");
  723.    GotoxyAbs(55,11);
  724.    scanf("%d",&StScan);
  725.  
  726.    ColorMsg(26,12,48,"Ending scan line         ==> ");
  727.    GotoxyAbs(55,12);
  728.    scanf("%d",&SpScan);
  729.  
  730.    SetCursorSize(StScan,SpScan);
  731.    ColorMsg(26,14,144," Press any key to continue...");
  732.    GetKey();
  733. }
  734.  
  735. void TestRvsAttr()
  736. {
  737.    char  St1[256],St2[256];
  738.    int   i,j,k,HiCur,LoCur;
  739.  
  740.    HiCur = (VioCursor >> 8);
  741.    LoCur = (VioCursor & 0xff);
  742.    SetCursorSize(32,32);
  743.    ClrWin(1,1,80,25,7);
  744.  
  745.    WindowFP(5,2,40,19);
  746.    FrameWin('╔','╗','╚','╝','═','║',7);
  747.    ColorMsg(7,2,7," Text with normal attributes ");
  748.  
  749.    WindowFP(45,2,80,19);
  750.    FrameWin('╔','╗','╚','╝','═','║',7);
  751.    ColorMsg(47,2,7," Text with reverse attributes ");
  752.  
  753.    for (k = 0, j = 1; j <= 16; j++) {
  754.       ClrWin(6,3,39,18,7);
  755.       ClrWin(46,3,79,18,7);
  756.       for (i = 0; i <= 15; i++) {
  757.  
  758.          str(k,3,St2);
  759.          strupr(St2);
  760.          strcpy(St1,"        TextAttr = ");
  761.          strcat(St1,St2);
  762.          strcat(St1,"            ");
  763.          ColorMsg(6,i+3,k,St1);
  764.  
  765.          RvsAttr(TextAttr);
  766.          str(k,3,St2);
  767.          strupr(St2);
  768.          strcpy(St1,"        TextAttr = ");
  769.          strcat(St1,St2);
  770.          strcat(St1,"            ");
  771.          ColorMsg(46,i+3,k,St1);
  772.          k = k + 1;
  773.       }
  774.       WindowFP(25,22,56,24);
  775.       FrameWin('╔','╗','╚','╝','═','║',7);
  776.       ColorMsg(26,23,144," Press any key to continue... ");
  777.       GetKey();
  778.       ClrWin(25,22,56,24,7);
  779.       Delay(200);
  780.    }
  781.    TextAttr = 6;
  782.    SetCursorSize(LoCur,HiCur);
  783. }
  784.  
  785.  
  786. void TestGetVideoMode()
  787. {
  788.    char St[256];
  789.    int  i;
  790.  
  791.    ClrWin(1,1,80,25,7);
  792.    WindowFP(20,11,60,13);
  793.    FrameWin('╔','╗','╚','╝','═','║',7);
  794.    i = GetVideoMode();
  795.    switch (i) {
  796.       case 0 : strcpy(St,"0 - CGA - Text b/w Medium resolution");
  797.                break;
  798.  
  799.       case 1 : strcpy(St,"1 - CGA - Text color Medium resolution");
  800.                break;
  801.  
  802.       case 2 : strcpy(St,"2 - CGA - Text b/w High resolution");
  803.                break;
  804.  
  805.       case 3 : strcpy(St,"3 - CGA - Text color High resolution");
  806.                break;
  807.  
  808.       case 7 : strcpy(St,"7 - Monochrome monitor");
  809.    }
  810.  
  811.    ColorMsg(22,11,TextAttr," Current video mode ");
  812.    ColorMsg(22,12,TextAttr,St);
  813.    ColorMsg(25,13,144,"Press any key to continue...");
  814.    GetKey();
  815. }
  816.  
  817.  
  818. void TestInitVideo()
  819. {
  820.    char  St[256],Error;
  821.    int   OldMode,NewMode,i;
  822.  
  823.    OldMode = GetVideoMode();
  824.    do {
  825.       InitVideo(OldMode);
  826.       ClrWin(1,1,80,25,7);
  827.       WindowFP(10,1,60,20);
  828.       FrameWin('╔','╗','╚','╝','═','║',7);
  829.       ColorMsg(12,1,TextAttr," SetVideoMode ");
  830.       ColorMsg(12,2,TextAttr," 0 - CGA - Text b/w Medium resolution");
  831.       ColorMsg(12,3,TextAttr," 1 - CGA - Text color Medium resolution");
  832.       ColorMsg(12,4,TextAttr," 2 - CGA - Text b/w High resolution");
  833.       ColorMsg(12,5,TextAttr," 3 - CGA - Text color High resolution");
  834.       ColorMsg(12,6,TextAttr," 4 - CGA - Graphics Medium resolution");
  835.       ColorMsg(12,7,TextAttr," 5 - CGA - Graphics Medium resolution");
  836.       ColorMsg(12,8,TextAttr," 6 - CGA - Graphics High resolution");
  837.       ColorMsg(12,9,TextAttr," 7 - Monochrome monitor");
  838.       ColorMsg(12,10,TextAttr," 8 - PCjr - Graphics Low resolution");
  839.       ColorMsg(12,11,TextAttr," 9 - PCjr - Graphics Medium resolution");
  840.       ColorMsg(12,12,TextAttr,"10 - PCjr,EGA - Graphics High resolution");
  841.       ColorMsg(12,13,TextAttr,"13 - EGA - Graphics Medium resolution");
  842.       ColorMsg(12,14,TextAttr,"14 - EGA - Graphics High resolution");
  843.       ColorMsg(12,15,TextAttr,"15 - EGA - Graphics Extra high resolution");
  844.       ColorMsg(12,16,TextAttr,"16 - Quit");
  845.       ColorMsg(12,18,TextAttr,"Select mode to initialize ==> ");
  846.       GotoxyAbs(42,18);
  847.       scanf("%d",&NewMode);
  848.       ClrWin(1,1,80,25,7);
  849.  
  850.       Error = 0;
  851.       if (OldMode == 7) {
  852.          if (NewMode != 7 && NewMode != 16)
  853.             Error++;
  854.       } else if (NewMode > 7 && NewMode < 16)
  855.          Error++;
  856.  
  857.       if (Error) {
  858.          strcpy(St,"Invalid mode was entered.  Press any key to continue");
  859.          ColorMsg(1,19,TextAttr,St);
  860.             GetKey();
  861.       } else if (NewMode != 16) {
  862.          ClrWin(1,1,80,25,7);
  863.          InitVideo(NewMode);
  864.          if ((NewMode >= 4  && NewMode <= 6)  ||
  865.              (NewMode >= 8  && NewMode <= 10) ||
  866.              (NewMode >= 13 && NewMode <= 15)) {
  867.             for (i = 0; i <= 15; i++)
  868.                printf("This is the new video mode\n");
  869.          } else if (NewMode >= 0 && NewMode <= 3)
  870.             for (i = 0; i <= 15; i++)
  871.                WriteStln("This is the new video mode");
  872.          printf("\n\nPress any key to continue...");
  873.          GetKey();
  874.       }
  875.  
  876.    } while (NewMode != 16);
  877. }
  878.  
  879. void TestGetVideoCols()
  880. {
  881.    char St1[256],St2[256];
  882.  
  883.    ClrWin(1,1,80,25,7);
  884.    WindowFP(24,10,57,13);
  885.    ClrWin(24,10,57,13,48);
  886.    FrameWin('╔','╗','╚','╝','═','║',48);
  887.    GotoxyAbs(1,1);
  888.    TextAttr = 48;
  889.    ColorMsg(26,10,48," GetVideoCols ");
  890.    itoa(GetVideoCols(),St2,10);
  891.    strcpy(St1," Number of columns = ");
  892.    strcat(St1,St2);
  893.    ColorMsg(26,11,48,St1);
  894.    ColorMsg(26,13,144," Press any key to continue...");
  895.    GetKey();
  896.    TextAttr = 7;
  897. }
  898.  
  899. void TestGetVideoPage()
  900. {
  901.    char  St1[256],St2[256];
  902.  
  903.    ClrWin(1,1,80,25,7);
  904.    WindowFP(24,10,57,13);
  905.    ClrWin(24,10,57,13,48);
  906.    FrameWin('╔','╗','╚','╝','═','║',48);
  907.    ColorMsg(26,10,48," GetVideoPage ");
  908.  
  909.    itoa(GetVideoPage(),St2,10);
  910.    strcpy(St1," Current video page number = ");
  911.    strcat(St1,St2);
  912.    ColorMsg(25,11,48,St1);
  913.    ColorMsg(25,12,48," Press any key to continue...");
  914.    GetKey();
  915.    TextAttr = 7;
  916. }
  917.  
  918. void TestGetVideoInfo()
  919. {
  920.    char St1[256],St2[256];
  921.  
  922.    ClrWin(1,1,80,25,7);
  923.    WindowFP(24,9,57,17);
  924.    ClrWin(24,9,57,17,48);
  925.    FrameWin('╔','╗','╚','╝','═','║',48);
  926.    ColorMsg(26,9,48," GetVideoInfo ");
  927.  
  928.    itoa(GetVideoMode(),St2,10);
  929.    strcpy(St1," Current mode         = ");
  930.    strcat(St1,St2);
  931.    ColorMsg(25,10,48,St1);
  932.  
  933.    itoa(GetVideoPage(),St2,10);
  934.    strcpy(St1," Active page          = ");
  935.    strcat(St1,St2);
  936.    ColorMsg(25,11,48,St1);
  937.  
  938.    itoa(GetVideoCols(),St2,10);
  939.    strcpy(St1," Number cols          = ");
  940.    strcat(St1,St2);
  941.    ColorMsg(25,12,48,St1);
  942.  
  943.    itoa(TextAttr,St2,10);
  944.    strcpy(St1," Text attribute       = ");
  945.    strcat(St1,St2);
  946.    ColorMsg(25,13,48,St1);
  947.  
  948.    itoa(VioBaseSeg,St2,16);
  949.    strupr(St2);
  950.    strcpy(St1," Base Segment Address = ");
  951.    strcat(St1,St2);
  952.    ColorMsg(25,14,48,St1);
  953.  
  954.    ColorMsg(25,16,48," Press any key to continue...");
  955.    GetKey();
  956. }
  957.  
  958.  
  959. void TestSetVideoPage()
  960. {
  961.    char St1[256],St2[256];
  962.    int  PgNo;
  963.  
  964.    ClrWin(1,1,80,25,7);
  965.    WindowFP(24,8,57,17);
  966.    ClrWin(24,8,57,17,48);
  967.    FrameWin('╔','╗','╚','╝','═','║',48);
  968.    GotoxyAbs(25,10);
  969.    ColorMsg(26,8,48," SetVideoPage ");
  970.  
  971.    itoa(GetVideoPage(),St2,10);
  972.    strcpy(St1," Current video page number = ");
  973.    strcat(St1,St2);
  974.    ColorMsg(25,9,48,St1);
  975.  
  976.    if (VioMode >= 0 && VioMode <= 3) {
  977.       do {
  978.          ColorMsg(25,10,48," Enter new page number ==> ");
  979.          GotoxyAbs(53,10);
  980.          scanf("%d",&PgNo);
  981.       } while (PgNo < 0 || PgNo > 3);
  982.       SetVideoPage(PgNo);
  983.       GotoxyAbs(1,1);
  984.  
  985.    } else if ( VioMode == 7 ) {
  986.       ClrWin(25,9,56,16,48);
  987.       ColorMsg(25,11,48," This is the only page allowed ");
  988.       ColorMsg(25,12,48," for a Monochrome monitor ");
  989.       ColorMsg(25,14,48,"Press any key to continue...");
  990.       GetKey();
  991.    }
  992. }
  993.  
  994.  
  995. void TestWhereXYAbs()
  996. {
  997.    char St1[256],St2[256];
  998.    int  Ch,Row,Col,done = 0;
  999.  
  1000.    ClrWin(1,1,80,25,7);
  1001.    FillColChar(1,1,25,'+');
  1002.    FillRowCell(1,3,80,('-' << 8) + 48);
  1003.    Col = 5;
  1004.    for (Col = 5; Col <= 80; Col += 5)
  1005.       FillRowChar(Col,3,1,'+');
  1006.  
  1007.    ColorMsg(5,6,TextAttr, "Press one of the following keys ");
  1008.    ColorMsg(5,7,TextAttr, "to move the cursor:");
  1009.    ColorMsg(5,8,TextAttr, "    U - move cursor up one line");
  1010.    ColorMsg(5,9,TextAttr, "    D - move cursor down one line");
  1011.    ColorMsg(5,10,TextAttr,"    R - move cursor right one column");
  1012.    ColorMsg(5,11,TextAttr,"    L - move cursor left one column");
  1013.    ColorMsg(5,12,TextAttr,"   <ENTER> - to return to menu");
  1014.    Row = 12;
  1015.    Col = 40;
  1016.  
  1017.    do {
  1018.       GotoxyAbs(Col,Row);
  1019.  
  1020.  
  1021.       itoa(WhereXAbs(),St2,10);
  1022.       strcpy(St1,"WhereXAbs = ");
  1023.       strcat(St1,St2);
  1024.       strcat(St1,"   ");
  1025.       ColorMsg(1,1,TextAttr,St1);
  1026.  
  1027.  
  1028.       itoa(WhereYAbs(),St2,10);
  1029.       strcpy(St1,"WhereYAbs = ");
  1030.       strcat(St1,St2);
  1031.       strcat(St1,"   ");
  1032.       ColorMsg(1,2,TextAttr,St1);
  1033.  
  1034.       Ch = GetKey();
  1035.       Ch = ( Ch > 132 ) ? Ch - 132 : Ch;
  1036.       Ch = UpCase( Ch );
  1037.       switch ( Ch ) {
  1038.          case 'U' : Row--;
  1039.                     if (Row < 1)
  1040.                        Row = 25;
  1041.                     break;
  1042.  
  1043.          case 'D' : Row++;
  1044.                     if (Row > 25)
  1045.                        Row = 1;
  1046.                     break;
  1047.  
  1048.          case 'L' : Col--;
  1049.                     if (Col < 1)
  1050.                        Col = 80;
  1051.                     break;
  1052.  
  1053.          case 'R' : Col++;
  1054.                     if (Col > 80)
  1055.                        Col = 1;
  1056.                     break;
  1057.  
  1058.          case '\r': done++;
  1059.       }
  1060.  
  1061.    } while (!done);
  1062. }
  1063.  
  1064. void TestScrollLeft()
  1065. {
  1066.    int   i,j,NTimes = 15;
  1067.    TCell Buffer[25][80];
  1068.  
  1069.    ClrWin(1,1,80,25,7);
  1070.    ClearTime();
  1071.    for ( i = 0; i < 25; i++ )
  1072.       for ( j = 0; j < 80; j++ ) {
  1073.          Buffer[i][j].Ch   = i+64;
  1074.          Buffer[i][j].Attr = i;
  1075.       }
  1076.  
  1077.    for (i = 1; i <= NTimes; i++) {
  1078.       PutScrn( 1, 1, 2000, Buffer[0] );
  1079.       GetKey();
  1080.  
  1081.       GetTime(&H1,&M1,&S1,&Sec100_1);
  1082.       ScrollLeft(1,1,80,25,TextAttr,i);
  1083.       GetTime(&H2,&M2,&S2,&Sec100_2);
  1084.  
  1085.       GetKey();
  1086.  
  1087.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  1088.          Total = Total + (Sec100_2 - Sec100_1);
  1089.       else {
  1090.          t1 = 100 - Sec100_1 + Sec100_2;
  1091.          Total = Total + t1;
  1092.       }
  1093.    }
  1094.    DisplayTime(NTimes);
  1095. }
  1096.  
  1097. void TestScrollRight()
  1098. {
  1099.    int   i,j,NTimes = 15;
  1100.    TCell Buffer[25][80];
  1101.  
  1102.    ClrWin(1,1,80,25,7);
  1103.    ClearTime();
  1104.    for ( i = 0; i < 25; i++ )
  1105.       for ( j = 0; j < 80; j++ ) {
  1106.          Buffer[i][j].Ch   = i+64;
  1107.          Buffer[i][j].Attr = i;
  1108.       }
  1109.    for (i = 1; i <= NTimes; i++) {
  1110.       PutScrn( 1, 1, 2000, Buffer[0] );
  1111.       GetKey();
  1112.  
  1113.       GetTime(&H1,&M1,&S1,&Sec100_1);
  1114.       ScrollRight(1,1,80,25,TextAttr,i);
  1115.       GetTime(&H2,&M2,&S2,&Sec100_2);
  1116.  
  1117.       GetKey();
  1118.  
  1119.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  1120.          Total = Total + (Sec100_2 - Sec100_1);
  1121.       else {
  1122.          t1 = 100 - Sec100_1 + Sec100_2;
  1123.          Total = Total + t1;
  1124.       }
  1125.    }
  1126.    DisplayTime(NTimes);
  1127. }
  1128.  
  1129. void TestScrollDown()
  1130. {
  1131.    int   i,j,NTimes = 15;
  1132.    TCell Buffer[25][80];
  1133.  
  1134.    ClrWin(1,1,80,25,7);
  1135.    ClearTime();
  1136.    for ( i = 0; i < 25; i++ )
  1137.       for ( j = 0; j < 80; j++ ) {
  1138.          Buffer[i][j].Ch   = i+64;
  1139.          Buffer[i][j].Attr = i;
  1140.       }
  1141.  
  1142.    for (i = 1; i <= NTimes; i++) {
  1143.       PutScrn( 1, 1, 2000, Buffer[0] );
  1144.       GetKey();
  1145.  
  1146.       GetTime(&H1,&M1,&S1,&Sec100_1);
  1147.       ScrollDown(1,1,80,25,TextAttr,i);
  1148.       GetTime(&H2,&M2,&S2,&Sec100_2);
  1149.  
  1150.       GetKey();
  1151.  
  1152.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  1153.          Total = Total + (Sec100_2 - Sec100_1);
  1154.       else {
  1155.          t1 = 100 - Sec100_1 + Sec100_2;
  1156.          Total = Total + t1;
  1157.       }
  1158.    }
  1159.    DisplayTime(NTimes);
  1160. }
  1161.  
  1162. void TestScrollUp()
  1163. {
  1164.    int   i,j,NTimes = 15;
  1165.    TCell Buffer[25][80];
  1166.  
  1167.    ClrWin(1,1,80,25,7);
  1168.    ClearTime();
  1169.    for ( i = 0; i < 25; i++ )
  1170.       for ( j = 0; j < 80; j++ ) {
  1171.          Buffer[i][j].Ch   = i+64;
  1172.          Buffer[i][j].Attr = i;
  1173.       }
  1174.  
  1175.    for (i = 1; i <= NTimes; i++) {
  1176.       PutScrn( 1, 1, 2000, Buffer[0] );
  1177.       GetKey();
  1178.  
  1179.       GetTime(&H1,&M1,&S1,&Sec100_1);
  1180.       ScrollUp(1,1,80,25,TextAttr,i);
  1181.       GetTime(&H2,&M2,&S2,&Sec100_2);
  1182.  
  1183.       GetKey();
  1184.  
  1185.       if ((Sec100_2 > Sec100_1) || ((S1 == S2) && (Sec100_1 == Sec100_2)))
  1186.          Total = Total + (Sec100_2 - Sec100_1);
  1187.       else {
  1188.          t1 = 100 - Sec100_1 + Sec100_2;
  1189.          Total = Total + t1;
  1190.       }
  1191.    }
  1192.    DisplayTime(NTimes);
  1193. }
  1194.  
  1195. void TestWriteSt()
  1196. {
  1197.    int  i;
  1198.  
  1199.    ClrWin(1,1,80,25,7);
  1200.    GotoxyAbs(1,1);
  1201.    for (i = 1; i <= 80; i++)
  1202.       WriteSt("This is a test...");
  1203.    GetKey();
  1204. }
  1205.  
  1206. void TestWriteStln()
  1207. {
  1208.    int  i;
  1209.  
  1210.    ClrWin(1,1,80,25,7);
  1211.    GotoxyAbs(1,1);
  1212.    for (i = 1; i <= 24; i++)
  1213.       WriteStln("This is a test...");
  1214.    GetKey();
  1215. }
  1216.  
  1217. GetMenuSelection()
  1218. {
  1219.    int Item = 0,
  1220.        result = 0;
  1221.  
  1222.    TextAttr = 7;
  1223.    do {
  1224.       ClrWin(1,1,80,25,7);
  1225.       WindowFP(1,1,80,25);
  1226.       GotoxyAbs(1,1);
  1227.       WriteStln(" ");
  1228.       WriteStln(" 1. BorderColor       2. ClrWin             3. ColorMsg");
  1229.       WriteStln(" 4. EditSt");
  1230.       WriteStln(" 5. FillColAttr       6. FillColCell        7. FillColChar");
  1231.       WriteStln(" 8. FillFrameAttr     9. FillFrameCell     10. FillFrameChar");
  1232.       WriteStln("11. FillRowAttr      12. FillRowCell       13. FillRowChar");
  1233.       WriteStln("14. GetFrameAttr     15. GetFrameCell      16. GetFrameChar");
  1234.       WriteStln("17. GetScrn          18. PutScrn");
  1235.       WriteStln("19. PutFrameAttr     20. PutFrameCell      21. PutFrameChar");
  1236.       WriteStln("22. GetCursorSize    23. SetCursorSize     24. FrameWin");
  1237.       WriteStln("25. RvsAttr          26. GetVideoMode      27. GetVideoCols");
  1238.       WriteStln("28. GetVideoPage     29. GetVideoInfo      30. InitVideo");
  1239.       WriteStln("31. SetVideoPage     32. GotoxyAbs");
  1240.       WriteStln("33. WhereXAbs        34. WhereYAbs");
  1241.       WriteStln("35. ScrollLeft       36. ScrollRight");
  1242.       WriteStln("37. ScrollDown       38. ScrollUp");
  1243.       WriteStln("39. WriteSt          40. WriteStln");
  1244.       WriteStln("41. Quit");
  1245.       WriteStln(" ");
  1246.       WriteSt("Enter selection to test ==> ");
  1247.       scanf("%u",&Item);
  1248.  
  1249.       while (Item < 1 || Item > 41) {
  1250.          result = scanf("%d",&Item);
  1251.          if (result != 1)
  1252.             Item = 0;
  1253.       }
  1254.  
  1255.    } while (Item < 1 || Item > 41);
  1256.    return(Item);
  1257. }
  1258.  
  1259.  
  1260. void main( void )
  1261. {
  1262.    int   done = 0;
  1263.  
  1264.    VioInit();
  1265.    ClrWin(1,1,80,25,7);
  1266.    GotoxyAbs(1,1);
  1267.    while (!done) {
  1268.       switch (GetMenuSelection()) {
  1269.          case  1 : TestBorderColor();
  1270.                    break;
  1271.  
  1272.          case  2 : TestClrWin();
  1273.                    break;
  1274.  
  1275.          case  3 : TestColorMsg();
  1276.                    break;
  1277.  
  1278.          case  4 : TestEditSt();
  1279.                    break;
  1280.  
  1281.          case  5 : TestFillColAttr();
  1282.                    break;
  1283.  
  1284.          case  6 : TestFillColCell();
  1285.                    break;
  1286.  
  1287.          case  7 : TestFillColChar();
  1288.                    break;
  1289.  
  1290.          case  8 : TestFillFrameAttr();
  1291.                    break;
  1292.  
  1293.          case  9 : TestFillFrameCell();
  1294.                    break;
  1295.  
  1296.          case 10 : TestFillFrameChar();
  1297.                    break;
  1298.  
  1299.          case 11 : TestFillRowAttr();
  1300.                    break;
  1301.  
  1302.          case 12 : TestFillRowCell();
  1303.                    break;
  1304.  
  1305.          case 13 : TestFillRowChar();
  1306.                    break;
  1307.  
  1308.          case 14 : TestGetFrameAttr();
  1309.                    break;
  1310.  
  1311.          case 15 : TestGetFrameCell();
  1312.                    break;
  1313.  
  1314.          case 16 : TestGetFrameChar();
  1315.                    break;
  1316.  
  1317.          case 17 : TestGetScrn();
  1318.                    break;
  1319.  
  1320.          case 18 : TestPutScrn();
  1321.                    break;
  1322.  
  1323.          case 19 : TestPutFrameAttr();
  1324.                    break;
  1325.  
  1326.          case 20 : TestPutFrameCell();
  1327.                    break;
  1328.  
  1329.          case 21 : TestPutFrameChar();
  1330.                    break;
  1331.  
  1332.          case 22 : TestGetCursorSize();
  1333.                    break;
  1334.  
  1335.          case 23 : TestSetCursorSize();
  1336.                    break;
  1337.  
  1338.          case 24 : TestFrameWin();
  1339.                    break;
  1340.  
  1341.          case 25 : TestRvsAttr();
  1342.                    break;
  1343.  
  1344.          case 26 : TestGetVideoMode();
  1345.                    break;
  1346.  
  1347.          case 27 : TestGetVideoCols();
  1348.                    break;
  1349.  
  1350.          case 28 : TestGetVideoPage();
  1351.                    break;
  1352.  
  1353.          case 29 : TestGetVideoInfo();
  1354.                    break;
  1355.  
  1356.          case 30 : TestInitVideo();
  1357.                    break;
  1358.  
  1359.          case 31 : TestSetVideoPage();
  1360.                    break;
  1361.  
  1362.          case 32 : TestWhereXYAbs();
  1363.                    break;
  1364.  
  1365.          case 33 : TestWhereXYAbs();
  1366.                    break;
  1367.  
  1368.          case 34 : TestWhereXYAbs();
  1369.                    break;
  1370.  
  1371.          case 35 : TestScrollLeft();
  1372.                    break;
  1373.  
  1374.          case 36 : TestScrollRight();
  1375.                    break;
  1376.  
  1377.          case 37 : TestScrollDown();
  1378.                    break;
  1379.  
  1380.          case 38 : TestScrollUp();
  1381.                    break;
  1382.  
  1383.          case 39 : TestWriteSt();
  1384.                    break;
  1385.  
  1386.          case 40 : TestWriteStln();
  1387.                    break;
  1388.  
  1389.          case 41 : done++;
  1390.       };
  1391.    };
  1392. }
  1393.  
  1394.