home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / KTOOLS.ZIP / KTLSDEMO.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1988-04-01  |  2.0 KB  |  93 lines

  1. {$R+,S+,I+,D+,T-,F-,V-,B-,N-,L+ }
  2. {$M 16384,16384,16384 }
  3. PROGRAM KTOOLSDEMO;
  4.  
  5. USES
  6.     DOS,
  7.     CRT,
  8.     KTOOLS;
  9.  
  10. VAR
  11.     Str80 : String[80];
  12.     Ch : Char;
  13.     Lines : array[1..6] OF Byte;
  14.     L,Z : Integer;
  15.     Fore,Back : Integer;
  16.  
  17. {  Variable sizes can be any size you choose only if we use $V- before our
  18.    calls to KTOOLS.TPU }
  19.  
  20.  
  21. BEGIN
  22.  
  23.    ClrScr;
  24.  
  25.    CursorOff;
  26.  
  27.    KWrite(2,1,15,'This line is passed as actual param. to KWrite');
  28.  
  29.    Str80:='Hello world, I''m Drue Kennon! was passed as a variable.';
  30.  
  31.    KWriteV(5,1,12,Str80);
  32.  
  33.    KWrite(8,1,15,'Next line is actual & centered');
  34.  
  35.    KWriteC(9,11,'Hello world, I''m Drue Kennon!');
  36.  
  37.    Str80:='Hello World, I''m a centered variable.';
  38.  
  39.    KWrite(11,1,15,'Next line is varriable & centered');
  40.  
  41.    KWriteCV(12,6,Str80);
  42.  
  43.    Str80:='          I had 10 leading blanks and 10 trailing ones          ';
  44.  
  45.    KWriteV(14,1,4,Str80);
  46.  
  47.    KTrim(Str80);
  48.  
  49.    KWrite(16,1,15,KUCase('Now I have none on either side of me!'));
  50.  
  51.    Kwrite(18,1,3,Str80);
  52.  
  53.    KWrite(20,1,15,'Now to change the attributes of these lines!');
  54.  
  55.    KWrite(22,1,15,'Press any key to fill the screen via (KFill)');
  56.  
  57.    Delay(5000);  {Pause for 15 secs or so.}
  58.  
  59.    Lines[1]:=2;
  60.    Lines[2]:=5;
  61.    Lines[3]:=9;
  62.    Lines[4]:=12;
  63.    Lines[5]:=14;
  64.    Lines[6]:=16;
  65.  
  66.    REPEAT
  67.    FOR Z := 0 TO 15 DO
  68.       BEGIN
  69.          FOR L := 1 To 6 DO
  70.             KAttr(Lines[l],1,1,80,Z);
  71.       END;
  72.    UNTIL KeyPressed;
  73.  
  74.    Ch := ReadKey; {swallow keypressed character}
  75.  
  76.    KFill(5,10,15,60,'*',121);
  77.  
  78.    CursorOn;
  79.  
  80.    KWrite(22,1,color(15,0),'                                                                      ');
  81.    KWrite(23,1,15,'Enter a foreground color i.e. 10, 13 etc...: ');
  82.    Read(Fore);
  83.  
  84.    KWrite(23,1,color(15,0),'                                                                      ');
  85.    Str80 := '';
  86.    Str80 := 'Enter a background color i.e. 0, 5 etc...: ';
  87.    KTrim(Str80);
  88.    KWriteV(23,1,15,Str80);
  89.    Read(Back);
  90.  
  91.    KFill(5,10,15,60,'*',Color(Fore,Back));
  92.  
  93. End.