home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / io / inputs / readme.ins < prev   
Encoding:
Text File  |  1988-06-02  |  7.2 KB  |  199 lines

  1. UNIT General:
  2.    Must include the compilier directive {$V-} at the beginning or
  3.    your code inorder to use these units.
  4.  
  5. Procedure color(forg,backg:byte;rev,blnk,under:boolean);
  6.               * Sets Color or Mono screens, thus making your
  7.                 code more portable
  8.               - forg : forground color
  9.               - Backg : background color
  10.               - Rev : Reverse video on or off(affects mono only)
  11.               - Blnk : Sets the blink bit on or off, if off
  12.                        you will get 16 background colors instead
  13.                        of 7.
  14.               - Under : Sets underline on or off(affects mono only)
  15.               {mono sets:   blnk + under
  16.                             rev + under}
  17.  
  18.  
  19. Procedure CursorOn(Turnon:Boolean);
  20.              * Turns on or off the cursor
  21.              - Turnon : if true it will turn on the cursor.
  22.                         if false it will turn off the cursor.
  23.  
  24. Procedure upper(var s : string80);
  25.              * Turns string to upper case.
  26.              - s :  any string variable 80 characters or less.
  27.  
  28. Procedure Box(double:boolean;upleftx, uplefty, lowrightx, lowrighty:byte);
  29.              * Draws a box screen box
  30.              - double : if false then single line else double
  31.              - upleftx,uplefty,lowlefty,lowrighty : upper right and
  32.                  lower left corners of the box.
  33.               { functional but needs work }
  34.  
  35. Procedure trim(var s : string80);
  36.              * Removes the trailing spaces on a string
  37.              - s : any string 80 characters or less
  38.  
  39. Procedure Beep;
  40.              * produces a beep
  41.  
  42. Procedure Center(y:integer; s : string80);
  43.              * centers a line on the screen
  44.              - y : row screen to print line
  45.              - s : any string 80 characters or less
  46.  
  47. Procedure writedate(InclDay:boolean;x,y : integer);
  48.              * writes a formated system date to the screen
  49.              - InclDay : It true then the date is lead with the
  50.                          day written out. ie. 'Saturday'
  51.              - X,Y : screen position for date
  52.  
  53. Procedure writetime(x,y : integer);
  54.              * write hours minutes and AM PM
  55.              - X,Y : screen position for Time
  56.  
  57. Procedure SysOper(CtrlBrkOn,PrntScrTog,StopSnow:boolean);
  58.             * Turns on and off special effects.
  59.             - CtrlBrkOn : if false then Control Break will not
  60.                           work to exit program.
  61.             - PrntscrTog : If false disable print screen key
  62.             - StopSnow : turns off direct screen write, some screens
  63.                          can't deal with it.
  64.  
  65. Procedure Linefeed(X : integer);
  66.             * sends line feed to printer
  67.             - X : number of line feeds
  68.  
  69. Procedure Formfeed;
  70.             * sends form feed to printer
  71.  
  72. Procedure SetPageLen(n : integer);
  73.             * Sets printer page length
  74.             - N : number of lines on page
  75.  
  76. Procedure NearLQ(on : boolean);
  77.             * turn on and off Near letter Quality on printers
  78.             - on : if true then NLQ is on
  79.  
  80. Procedure condensed(on : boolean);
  81.             * Turn on and off condensed print
  82.             - on : if true then Condensed is on
  83.  
  84. Procedure Underline(on : boolean);
  85.             * Turn on and off underline print
  86.             - on : if true then underline on
  87.  
  88. Function  PrinterOn: boolean;
  89.             * Returns true if printer is ready for output.
  90.  
  91. Procedure Scroll(upLeftx,UpLeftY,LoRightX,LoRightY,Direction:integer);
  92.                    {Direction: left - 0, right - 1, up - 2, down - 3}
  93.             * Scroll text across portion of screen.
  94.             - Sorry can't take credit for this one but it works.
  95.               set box corners then direction
  96.  
  97. Procedure LeftTrim( Var s: string80);
  98.             * Removes the leading spaces from the string
  99.             - s : any string 80 characters or less
  100.  
  101. Function  Space(x:byte):string80;
  102.             * returns a string with X spaces
  103.             - used for filling a string ie. mystring := space(5);
  104.  
  105. Function  Julian(Year : integer;Mon, Day : byte):real;
  106.             * changes a date to julian for calculations
  107.             - example: DaysBetween := julian(88,12,32) - julian(88,03,15);
  108.  
  109. Procedure RemoveSpaces(var s:string80);
  110.            * Removes ALL spaces from a string
  111.            - s : any string 80 Characters or less
  112.  
  113. Function  FuncKey(Var Key : char):boolean;
  114.            * test for function key if true changes KEY to second readkey;
  115.            - example:
  116.                MyKey := readkey;
  117.                If funcKey(MyKey) then
  118.                   case Mykey of
  119.                      #80 :  {down arrow}
  120.                      #83 :  {delete key}
  121.                      etc:
  122.                   end
  123.               else
  124.                  case Mykey of
  125.                      'a':
  126.                      'b':
  127.                      etc:
  128.                  end;
  129.  
  130. Procedure PadSpaces(Var s:string80; TotalLen : integer);
  131.             * Adds spaces at the end of the string
  132.             - s: any string 80 characters or less
  133.             - TotalLen: Total string Length desired.
  134.  
  135. Function  ValidDate(s:string8):boolean;
  136.             * tests to see if date is a valid date
  137.             - s : string FORMAT: MM/DD/YY
  138.  
  139. Function  ValidNumber(s:string80):boolean;
  140.             * tests to see if string is valid number
  141.             - s: string 80 characters or less
  142.  
  143. {-----------------------------------------------------------------}
  144.  
  145. UNIT Inputs:
  146. uses Crt, dos, General;
  147.  
  148. Type
  149.   string80 = string[80];
  150.   Input_control_block = Record
  151.                           X,Y,Len,
  152.                           up,down    : byte;
  153.                           Typeof     : char;
  154.                           Decimal    : byte;
  155.                           filler     : string80;
  156.                         end;
  157.   Input_screen = Array[1..25] of input_control_block;
  158.  
  159.  
  160.  
  161.  
  162. var
  163.   input : Input_screen;
  164.  
  165. Function getinput(Starter,forg,backg:byte):Boolean;
  166.      * Sets up input screen and gets data or changes data
  167.      - starter: Input number to start with : used when data is
  168.        incorrect and you want the user back to that input area first.
  169.        Else just set to 1.
  170.      - Forg,Backg: Forground or background colors, will set mono to
  171.                    reverse video automatically.
  172.      {If the user hits the escape key the edit will end and getinput
  173.       will be false, else getinput will be true}
  174.  
  175.            *****    SEE EXAMPLE.PAS   *****
  176.  
  177. INPUT Array:
  178.      - X,Y : Start point of input string on screen
  179.      - len : Total Lenght of String
  180.      - up  : Which input to go to if up arrow is pressed. If zero
  181.               then end input.
  182.      - down: Which input to go to if down arrow or return is pressed.
  183.               If zero then end input.
  184.      -Typeof : 'A' : Alpha Numeric
  185.                'D' : Date
  186.                'L' : Logical
  187.                'N' : Number
  188.      - Decimal : Number of decimal places if number
  189.      - Filler : put in data if screen used for edit else
  190.                 put equal to '@'
  191.  
  192. **************************************************************************
  193. I hope you find a use for these units. If you have any questions then You
  194. can reach me on compuserve:
  195.  
  196.                              Michael Potter
  197.                      Compuserve Number : 71131,1071
  198.  
  199.