home *** CD-ROM | disk | FTP | other *** search
- UNIT General:
- Must include the compilier directive {$V-} at the beginning or
- your code inorder to use these units.
-
- Procedure color(forg,backg:byte;rev,blnk,under:boolean);
- * Sets Color or Mono screens, thus making your
- code more portable
- - forg : forground color
- - Backg : background color
- - Rev : Reverse video on or off(affects mono only)
- - Blnk : Sets the blink bit on or off, if off
- you will get 16 background colors instead
- of 7.
- - Under : Sets underline on or off(affects mono only)
- {mono sets: blnk + under
- rev + under}
-
-
- Procedure CursorOn(Turnon:Boolean);
- * Turns on or off the cursor
- - Turnon : if true it will turn on the cursor.
- if false it will turn off the cursor.
-
- Procedure upper(var s : string80);
- * Turns string to upper case.
- - s : any string variable 80 characters or less.
-
- Procedure Box(double:boolean;upleftx, uplefty, lowrightx, lowrighty:byte);
- * Draws a box screen box
- - double : if false then single line else double
- - upleftx,uplefty,lowlefty,lowrighty : upper right and
- lower left corners of the box.
- { functional but needs work }
-
- Procedure trim(var s : string80);
- * Removes the trailing spaces on a string
- - s : any string 80 characters or less
-
- Procedure Beep;
- * produces a beep
-
- Procedure Center(y:integer; s : string80);
- * centers a line on the screen
- - y : row screen to print line
- - s : any string 80 characters or less
-
- Procedure writedate(InclDay:boolean;x,y : integer);
- * writes a formated system date to the screen
- - InclDay : It true then the date is lead with the
- day written out. ie. 'Saturday'
- - X,Y : screen position for date
-
- Procedure writetime(x,y : integer);
- * write hours minutes and AM PM
- - X,Y : screen position for Time
-
- Procedure SysOper(CtrlBrkOn,PrntScrTog,StopSnow:boolean);
- * Turns on and off special effects.
- - CtrlBrkOn : if false then Control Break will not
- work to exit program.
- - PrntscrTog : If false disable print screen key
- - StopSnow : turns off direct screen write, some screens
- can't deal with it.
-
- Procedure Linefeed(X : integer);
- * sends line feed to printer
- - X : number of line feeds
-
- Procedure Formfeed;
- * sends form feed to printer
-
- Procedure SetPageLen(n : integer);
- * Sets printer page length
- - N : number of lines on page
-
- Procedure NearLQ(on : boolean);
- * turn on and off Near letter Quality on printers
- - on : if true then NLQ is on
-
- Procedure condensed(on : boolean);
- * Turn on and off condensed print
- - on : if true then Condensed is on
-
- Procedure Underline(on : boolean);
- * Turn on and off underline print
- - on : if true then underline on
-
- Function PrinterOn: boolean;
- * Returns true if printer is ready for output.
-
- Procedure Scroll(upLeftx,UpLeftY,LoRightX,LoRightY,Direction:integer);
- {Direction: left - 0, right - 1, up - 2, down - 3}
- * Scroll text across portion of screen.
- - Sorry can't take credit for this one but it works.
- set box corners then direction
-
- Procedure LeftTrim( Var s: string80);
- * Removes the leading spaces from the string
- - s : any string 80 characters or less
-
- Function Space(x:byte):string80;
- * returns a string with X spaces
- - used for filling a string ie. mystring := space(5);
-
- Function Julian(Year : integer;Mon, Day : byte):real;
- * changes a date to julian for calculations
- - example: DaysBetween := julian(88,12,32) - julian(88,03,15);
-
- Procedure RemoveSpaces(var s:string80);
- * Removes ALL spaces from a string
- - s : any string 80 Characters or less
-
- Function FuncKey(Var Key : char):boolean;
- * test for function key if true changes KEY to second readkey;
- - example:
- MyKey := readkey;
- If funcKey(MyKey) then
- case Mykey of
- #80 : {down arrow}
- #83 : {delete key}
- etc:
- end
- else
- case Mykey of
- 'a':
- 'b':
- etc:
- end;
-
- Procedure PadSpaces(Var s:string80; TotalLen : integer);
- * Adds spaces at the end of the string
- - s: any string 80 characters or less
- - TotalLen: Total string Length desired.
-
- Function ValidDate(s:string8):boolean;
- * tests to see if date is a valid date
- - s : string FORMAT: MM/DD/YY
-
- Function ValidNumber(s:string80):boolean;
- * tests to see if string is valid number
- - s: string 80 characters or less
-
- {-----------------------------------------------------------------}
-
- UNIT Inputs:
- uses Crt, dos, General;
-
- Type
- string80 = string[80];
- Input_control_block = Record
- X,Y,Len,
- up,down : byte;
- Typeof : char;
- Decimal : byte;
- filler : string80;
- end;
- Input_screen = Array[1..25] of input_control_block;
-
-
-
-
- var
- input : Input_screen;
-
- Function getinput(Starter,forg,backg:byte):Boolean;
- * Sets up input screen and gets data or changes data
- - starter: Input number to start with : used when data is
- incorrect and you want the user back to that input area first.
- Else just set to 1.
- - Forg,Backg: Forground or background colors, will set mono to
- reverse video automatically.
- {If the user hits the escape key the edit will end and getinput
- will be false, else getinput will be true}
-
- ***** SEE EXAMPLE.PAS *****
-
- INPUT Array:
- - X,Y : Start point of input string on screen
- - len : Total Lenght of String
- - up : Which input to go to if up arrow is pressed. If zero
- then end input.
- - down: Which input to go to if down arrow or return is pressed.
- If zero then end input.
- -Typeof : 'A' : Alpha Numeric
- 'D' : Date
- 'L' : Logical
- 'N' : Number
- - Decimal : Number of decimal places if number
- - Filler : put in data if screen used for edit else
- put equal to '@'
-
- **************************************************************************
- I hope you find a use for these units. If you have any questions then You
- can reach me on compuserve:
-
- Michael Potter
- Compuserve Number : 71131,1071
-