home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / KTOOLS31.ZIP / KTOOLS.DOC < prev    next >
Encoding:
Text File  |  1988-01-19  |  7.7 KB  |  168 lines

  1. KTOOLS version 3.0 {Drue Kennon}
  2.  
  3. TYPE
  4.     Colors       = 0..15;
  5.     MenuItemType = String[30];
  6.     MenuDescType = String[80];
  7.     ScrType      = Array[1..4004] OF Byte;
  8.     SaveScrType  = ^ScrType;
  9.     BorderType   = Record
  10.                       TL,TR,BL,BR,FH,FV : Char;
  11.                    End;
  12.     AllFiles=ARRAY[1..500] of String[12];
  13.  
  14. CONST
  15.       Border1 : BorderType = (TL:'╔';TR:'╗';BL:'╚';BR:'╝';FH:'═';FV:'║');
  16.       Border2 : BorderType = (TL:'╒';TR:'╕';BL:'╘';BR:'╛';FH:'═';FV:'│');
  17.       Border3 : BorderType = (TL:'┌';TR:'┐';BL:'└';BR:'┘';FH:'─';FV:'│');
  18.       Border4 : BorderType = (TL:'░';TR:'░';BL:'░';BR:'░';FH:'░';FV:'░');
  19.       Border5 : BorderType = (TL:'▓';TR:'▓';BL:'▓';BR:'▓';FH:'▓';FV:'▓');
  20.  
  21. VAR
  22.     ActiveDP  : Byte;     (* Active Display Page               *)
  23.     LineWidth : Integer;  (* Line Width of current video mode  *)
  24.     VideoMode : Byte;     (* Current Video Mode i.e. 0,1,2,3,7 *)
  25.     ErrorCode : Integer;  (* Global integer for error traps    *)
  26.  
  27. FUNCTION CurrentVideoMode : Byte;
  28. PROCEDURE CursorOn;
  29. PROCEDURE CursorOff;
  30. FUNCTION KUCase(S:String):String;
  31. FUNCTION KLCase(S:String):String;
  32. FUNCTION Color(FG,BG:Colors):Byte;
  33. PROCEDURE KAttr(Row,Col,Rows,Cols:Integer;Attr:Byte);
  34. PROCEDURE KFill(Row,Col,Rows,Cols:Integer;Ch:Char;Attr:Byte);
  35. PROCEDURE KTrim(VAR S:String);
  36. PROCEDURE KWrite(Row,Col:Integer;Attr:Byte;S:String);
  37. PROCEDURE KWriteV(Row,Col:Integer;Attr:Byte;VAR S:String);
  38. PROCEDURE KWriteC(Row:Integer;Attr:Byte;S:String);
  39. PROCEDURE KWriteCV(Row:Integer;Attr:Byte;VAR S:String);
  40. FUNCTION ReadPen:Integer;
  41. FUNCTION PenPosition(Row,Col:Byte):Integer;
  42. FUNCTION PenRow(Pen_Position:Integer):Byte;
  43. FUNCTION PenCol(Pen_Position:Integer):Byte;
  44. PROCEDURE KSaveScr(ULRow,ULCol,Rows,Cols : Byte;
  45.                    VAR Dest_Variable     : SaveScrType);
  46.  
  47. PROCEDURE KRestoreScr(Source_Variable    : SaveScrType);
  48.  
  49. PROCEDURE KBox (ULRow,ULCol,Rows,Cols: Integer;
  50.                 FrameAttr,WindowAttr : Byte;
  51.                 Border               : BorderType;
  52.                 ClearWindow          : Boolean);
  53.  
  54. FUNCTION KVertMenu(Selection_Start : INTEGER;{starting menu selection hilited}
  55.                    VAR MenuList;             {list of menu items             }
  56.                    MenuItemTotal,            {total number of menu items     }
  57.                    XStart,                   {starting column position       }
  58.                    YStart,                   {starting row postition         }
  59.                    XHiliteStart,             {hilite starting column number  }
  60.                    LengthOfHilite,           {number of columns to hilite    }
  61.                    NormalAttr,               {normal text attribute for menu }
  62.                    HiliteAttr :              {attribute of hilited item      }
  63.                    INTEGER):INTEGER;         {function returns integer value }
  64.  
  65. FUNCTION KHorizMenu(Selection_Start:INTEGER; {starting menu selection hilited}
  66.                     VAR MenuList,            {list of menu items             }
  67.                         MenuDesc;            {description of each item       }
  68.                     MenuItemTotal,           {total number of menu items     }
  69.                     MenuWindowWidth,         {number of columns for menu     }
  70.                     XStart,                  {starting column position       }
  71.                     YStart,                  {starting row postition         }
  72.                     NormalAttr,              {normal text attribute for menu }
  73.                     HiliteAttr,              {attribute of hilited item      }
  74.                     DescAttr:                {color for descriptions         }
  75.                     INTEGER):INTEGER;        {function returns integer value }
  76.  
  77. PROCEDURE  CopyFile(Input_File,              {filename.ext of file to copy}
  78.                     Output_File              {filename.ext of created file}
  79.                     :String;
  80.                     VAR Return_Code          {DOS error return code}
  81.                     :Integer;
  82.                     EraseInputFile           {retain original file flag}
  83.                     :Boolean);
  84.  
  85. FUNCTION IntToHex(IntNum:Integer):String;
  86. FUNCTION Space(Number:Integer):String;
  87.  
  88. PROCEDURE DirFill(VAR Path:String;      {declared search path}
  89.                   VAR Files:AllFiles;   {array of all files in the directory}
  90.                   VAR Counter:Integer;  {total number of files in the dir }
  91.                   IncludeDIR:Boolean);  {include directory listings}
  92.  
  93. PROCEDURE SortDir(VAR Files:AllFiles;   {array of all files in the directory}
  94.                   VAR Counter:Integer); {number of files you want sorted in}
  95.                                         {FILES up to the total number of files}
  96.  
  97. FUNCTION PikDir(Path:String;        {path to pick directory}
  98.                 IncludeDIR:Boolean  {include directory listings with files}
  99.                 ):String;
  100.  
  101.  
  102. Listed are the procedures and functions contained in KTOOLS30.pas/tpu. I put
  103. these routines together for the purpose of helping others see that you do not
  104. always have to resort to inline/assembly routines to get a job done.  There
  105. was a time when I spent days looking up and writing assembly interfaces to use
  106. with my programs. Granted, MASM 5.0 and CodeView have made that job easier but
  107. I like what TP4 has to offer without external stuff. In some fashion I use all
  108. the routines included in KTOOLS.  As I search my source code and find useful
  109. routines that I've converted to TP4 they will also be included in the KTOOLS
  110. package.
  111.  
  112. These simple routines take advantage of the new abilities of TP4 and are
  113. hereby declared Public Domain property if such a statement is needed.
  114. Also it is fashionable to say that these routines did not blow my CPU's mind,
  115. but if yours has one foot in the grave and the other on a banana peel and
  116. croaks off well..... if you use these routines, you in what ever language is
  117. in use, agree with me that I didn't have a thing to do with it.  If you
  118. like them and want to support my programming then 5 bucks cash is helpful.
  119. If you just like what they may have shown you about writing such routines
  120. then a call will be welcomed.
  121.  
  122. The Programmers'Source
  123. Rt 2 Box 54
  124. Center, Tx. 75935
  125. DataLine 409-598-9057
  126. Voice 409-598-3809 if I or the XYL are home.
  127.  
  128. I have tried to use things that TP4 provides as well as BIOS calls to show
  129. their usage in the routines.
  130.  
  131. KTOOLS.pas has documentation enough to point you in the right direction if
  132. you wish to change these to suit your own needs.
  133.  
  134. KxxxxMenu uses the ABSOLUTE statement to access a menu item list of
  135. menuitemtype passed to the function as an array. When you declare your
  136. menulist name, it should be declared as:
  137.  
  138. VAR
  139.     YourMenuName : Array[1..?] OF MenuItemType;
  140.     YourMenuNameTotal : INTEGER;
  141.  
  142. ......
  143. BEGIN
  144. ......
  145. MyMenuTotal := ?;
  146.  
  147. where ? is the total number of menu items in both places above.
  148. MenuItemType is typed as string[30] hence, hold your selection names to 30 char
  149. acters or less, or change it to suit your length in KTOOLS.PAS and recompile.
  150.  
  151.  
  152. If you do modify these and figure on turning them loose in the world, please
  153. make a note to the effect that you made the modifications.  Also do me a favor
  154. and change name of the file as I will be adding to these as I go along and they
  155. will be released with a version extention to KTOOLS.
  156.  
  157. If you use these routines in your program don't forget to send along all these
  158. source files if you release your program source code.
  159.  
  160. I hope these provide help to some TP4 programmers.  Don't forget call,write or
  161. drop by anytime.
  162.                                       Drue Kennon
  163.  
  164. P.S. Not responsible for typo errors in documentation.
  165.  
  166. KTOOLS Copyright (c) 1987 by Personalized Computer Programming Co.
  167.  
  168.