home *** CD-ROM | disk | FTP | other *** search
- KTOOLS version 3.0 {Drue Kennon}
-
- TYPE
- Colors = 0..15;
- MenuItemType = String[30];
- MenuDescType = String[80];
- ScrType = Array[1..4004] OF Byte;
- SaveScrType = ^ScrType;
- BorderType = Record
- TL,TR,BL,BR,FH,FV : Char;
- End;
- AllFiles=ARRAY[1..500] of String[12];
-
- CONST
- Border1 : BorderType = (TL:'╔';TR:'╗';BL:'╚';BR:'╝';FH:'═';FV:'║');
- Border2 : BorderType = (TL:'╒';TR:'╕';BL:'╘';BR:'╛';FH:'═';FV:'│');
- Border3 : BorderType = (TL:'┌';TR:'┐';BL:'└';BR:'┘';FH:'─';FV:'│');
- Border4 : BorderType = (TL:'░';TR:'░';BL:'░';BR:'░';FH:'░';FV:'░');
- Border5 : BorderType = (TL:'▓';TR:'▓';BL:'▓';BR:'▓';FH:'▓';FV:'▓');
-
- VAR
- ActiveDP : Byte; (* Active Display Page *)
- LineWidth : Integer; (* Line Width of current video mode *)
- VideoMode : Byte; (* Current Video Mode i.e. 0,1,2,3,7 *)
- ErrorCode : Integer; (* Global integer for error traps *)
-
- FUNCTION CurrentVideoMode : Byte;
- PROCEDURE CursorOn;
- PROCEDURE CursorOff;
- FUNCTION KUCase(S:String):String;
- FUNCTION KLCase(S:String):String;
- FUNCTION Color(FG,BG:Colors):Byte;
- PROCEDURE KAttr(Row,Col,Rows,Cols:Integer;Attr:Byte);
- PROCEDURE KFill(Row,Col,Rows,Cols:Integer;Ch:Char;Attr:Byte);
- PROCEDURE KTrim(VAR S:String);
- PROCEDURE KWrite(Row,Col:Integer;Attr:Byte;S:String);
- PROCEDURE KWriteV(Row,Col:Integer;Attr:Byte;VAR S:String);
- PROCEDURE KWriteC(Row:Integer;Attr:Byte;S:String);
- PROCEDURE KWriteCV(Row:Integer;Attr:Byte;VAR S:String);
- FUNCTION ReadPen:Integer;
- FUNCTION PenPosition(Row,Col:Byte):Integer;
- FUNCTION PenRow(Pen_Position:Integer):Byte;
- FUNCTION PenCol(Pen_Position:Integer):Byte;
- PROCEDURE KSaveScr(ULRow,ULCol,Rows,Cols : Byte;
- VAR Dest_Variable : SaveScrType);
-
- PROCEDURE KRestoreScr(Source_Variable : SaveScrType);
-
- PROCEDURE KBox (ULRow,ULCol,Rows,Cols: Integer;
- FrameAttr,WindowAttr : Byte;
- Border : BorderType;
- ClearWindow : Boolean);
-
- FUNCTION KVertMenu(Selection_Start : INTEGER;{starting menu selection hilited}
- VAR MenuList; {list of menu items }
- MenuItemTotal, {total number of menu items }
- XStart, {starting column position }
- YStart, {starting row postition }
- XHiliteStart, {hilite starting column number }
- LengthOfHilite, {number of columns to hilite }
- NormalAttr, {normal text attribute for menu }
- HiliteAttr : {attribute of hilited item }
- INTEGER):INTEGER; {function returns integer value }
-
- FUNCTION KHorizMenu(Selection_Start:INTEGER; {starting menu selection hilited}
- VAR MenuList, {list of menu items }
- MenuDesc; {description of each item }
- MenuItemTotal, {total number of menu items }
- MenuWindowWidth, {number of columns for menu }
- XStart, {starting column position }
- YStart, {starting row postition }
- NormalAttr, {normal text attribute for menu }
- HiliteAttr, {attribute of hilited item }
- DescAttr: {color for descriptions }
- INTEGER):INTEGER; {function returns integer value }
-
- PROCEDURE CopyFile(Input_File, {filename.ext of file to copy}
- Output_File {filename.ext of created file}
- :String;
- VAR Return_Code {DOS error return code}
- :Integer;
- EraseInputFile {retain original file flag}
- :Boolean);
-
- FUNCTION IntToHex(IntNum:Integer):String;
- FUNCTION Space(Number:Integer):String;
-
- PROCEDURE DirFill(VAR Path:String; {declared search path}
- VAR Files:AllFiles; {array of all files in the directory}
- VAR Counter:Integer; {total number of files in the dir }
- IncludeDIR:Boolean); {include directory listings}
-
- PROCEDURE SortDir(VAR Files:AllFiles; {array of all files in the directory}
- VAR Counter:Integer); {number of files you want sorted in}
- {FILES up to the total number of files}
-
- FUNCTION PikDir(Path:String; {path to pick directory}
- IncludeDIR:Boolean {include directory listings with files}
- ):String;
-
-
- Listed are the procedures and functions contained in KTOOLS30.pas/tpu. I put
- these routines together for the purpose of helping others see that you do not
- always have to resort to inline/assembly routines to get a job done. There
- was a time when I spent days looking up and writing assembly interfaces to use
- with my programs. Granted, MASM 5.0 and CodeView have made that job easier but
- I like what TP4 has to offer without external stuff. In some fashion I use all
- the routines included in KTOOLS. As I search my source code and find useful
- routines that I've converted to TP4 they will also be included in the KTOOLS
- package.
-
- These simple routines take advantage of the new abilities of TP4 and are
- hereby declared Public Domain property if such a statement is needed.
- Also it is fashionable to say that these routines did not blow my CPU's mind,
- but if yours has one foot in the grave and the other on a banana peel and
- croaks off well..... if you use these routines, you in what ever language is
- in use, agree with me that I didn't have a thing to do with it. If you
- like them and want to support my programming then 5 bucks cash is helpful.
- If you just like what they may have shown you about writing such routines
- then a call will be welcomed.
-
- The Programmers'Source
- Rt 2 Box 54
- Center, Tx. 75935
- DataLine 409-598-9057
- Voice 409-598-3809 if I or the XYL are home.
-
- I have tried to use things that TP4 provides as well as BIOS calls to show
- their usage in the routines.
-
- KTOOLS.pas has documentation enough to point you in the right direction if
- you wish to change these to suit your own needs.
-
- KxxxxMenu uses the ABSOLUTE statement to access a menu item list of
- menuitemtype passed to the function as an array. When you declare your
- menulist name, it should be declared as:
-
- VAR
- YourMenuName : Array[1..?] OF MenuItemType;
- YourMenuNameTotal : INTEGER;
-
- ......
- BEGIN
- ......
- MyMenuTotal := ?;
-
- where ? is the total number of menu items in both places above.
- MenuItemType is typed as string[30] hence, hold your selection names to 30 char
- acters or less, or change it to suit your length in KTOOLS.PAS and recompile.
-
-
- If you do modify these and figure on turning them loose in the world, please
- make a note to the effect that you made the modifications. Also do me a favor
- and change name of the file as I will be adding to these as I go along and they
- will be released with a version extention to KTOOLS.
-
- If you use these routines in your program don't forget to send along all these
- source files if you release your program source code.
-
- I hope these provide help to some TP4 programmers. Don't forget call,write or
- drop by anytime.
- Drue Kennon
-
- P.S. Not responsible for typo errors in documentation.
-
- KTOOLS Copyright (c) 1987 by Personalized Computer Programming Co.
-
-