home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / PASCAL / DESQ10 / DESQQWIK.PAS < prev   
Pascal/Delphi Source File  |  1988-06-05  |  3KB  |  85 lines

  1. { =========================================================================== }
  2. { DESQqwik.pas - Demo for DESQview interface routines      ver 1.0, 06-05-88  }
  3. {                and the use of QWIK41A.TPU                                   }
  4. { It is assumed that you are an operator of DESQview and that you are         }
  5. { familiar with it's operation.                                               }
  6. { TO TEST:                                                                    }
  7. {   1. Make DESQdemo.exe with QWIK.TPU.                                       }
  8. {   2. Compile DESQloop.exe.                                                  }
  9. {   3. Add these programs to DV with Direct video = "N".                      }
  10. {   4. Run DESQloop in one or more windows, say 1 and 2.                      }
  11. {   5. Run this program in another one, say 3.                                }
  12. {   6. Observe results.                                                       }
  13. { TO USE:                                                                     }
  14. {   1. Optionally rename DESQ10.TPU to DESQ.TPU                               }
  15. {   2. Follow instruction provided by DESQview                                }
  16. {   3. For high speed buffer writing to a DESQview window, use QWIK41A.ARC    }
  17. { by James H. LeMay, CIS 76011,217                                            }
  18. { =========================================================================== }
  19.  
  20. program DESQdemo;
  21.  
  22. USES Crt, Qwik,{$U DESQ10} DESQ;
  23.  
  24. var
  25.   DV_version: word;
  26.   Strng:      string;
  27.  
  28. type
  29.   Str9 = string[9];
  30.  
  31. { -- Converts any number into a Hex character string -- }
  32. function DecToHex (Number: longint; HexChars: byte): str9;
  33. const
  34.   D2H: array[0..$F] of char = '0123456789ABCDEF';
  35. var
  36.   HexStr:       Str9;
  37.   HexChar,Bits: byte;
  38. begin
  39.   HexStr:='';
  40.   for HexChar:=0 to pred(HexChars) do
  41.     begin
  42.       Bits:=HexChar shl 2;
  43.       HexStr:=D2H[(Number shr Bits) and $F] + HexStr;
  44.     end;
  45.   DecToHex:='$' + HexStr;
  46. end;
  47.  
  48. procedure ClearScr (Attrib: integer);
  49. begin
  50.   Qfill (1,1,CRTrows,CRTcols,Attrib,' ');
  51. end;
  52.  
  53. begin
  54.   Page0seg:=DV_Get_Video_Buffer (Page0seg);    { Base of Video segment }
  55.   Qseg:=Page0seg;                              { Segment for Qwik writing }
  56.   DV_Version:=DV_Get_Version;   { Optional }
  57.   if DV_Version=0 then
  58.     begin
  59.       ClearScr (TextAttr);
  60.       Qwrite (1,2,SameAttr,'DESQview not active');
  61.       GotoRC (2,1);
  62.     end
  63.   else
  64.     begin
  65.       Qsnow:=false;
  66.       ClearScr (SameAttr);
  67.       Qwrite     (1,1,SameAttr,'DESQview version = ');
  68.       Str        ((Hi(DV_Version)+Lo(DV_Version)/100):4:2,Strng);
  69.       QwriteMore (SameAttr,Strng);
  70.       Qwrite     (2,1,SameAttr,'Video Segment = ');
  71.       QwriteMore (SameAttr,DecToHex(Page0seg,4));
  72.       Qwrite     (3,1,SameAttr,'First character in row 1 is = ');
  73.       QwriteMore (SameAttr,char(Mem[Page0seg:0]));
  74.       Qwrite     (4,1,SameAttr,'All windows should now freeze for 3 seconds');
  75.       GotoRC     (5,1);
  76.       Crt.delay (1000);
  77.       DV_Begin_Critical;
  78.       Crt.delay (3000);
  79.       DV_End_Critical;
  80.       Qwrite (5,1,SameAttr,'Now all windows will continue.');
  81.       Qwrite (6,1,SameAttr,'Test completed.  Scroll back to see row 1.');
  82.       GotoRC (7,1);
  83.     end
  84. end.
  85.