home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / XTRADOS.ZIP / XTRADOS.DOC next >
Encoding:
Text File  |  1992-09-27  |  4.7 KB  |  160 lines

  1.                            XtraDos Unit Documentation
  2.                            (c) 1992 Richard Morey
  3.                      Turbo Pascal v.6.0 is a Registered
  4.                      Trademark of Borland International
  5.  
  6.         I developed the procedures and functions in this unit out of need.
  7. I was working on a large program and their were things I need to do
  8. repeatedly, such as enclosing text in a box and centering it on the screen.
  9. Anyway, I've decided that maybe other people would like these procedures
  10. and functions as well, so here they are.
  11.  
  12.         If you find them useful and would like to see me develop more of
  13. them, please send a donation to:
  14.  
  15.                                 Richard Morey
  16.                                 131 East 23rd Street
  17.                                 Apartment 10E
  18.                                 New York, N.Y. 10010
  19.  
  20.         I can be reached on The Invention Factory BBS in NYC,
  21. (212)-274-8110 if you want to E-Mail me. If you have any ideas for
  22. procedures or functions you'd like to see, please let me know!
  23.  
  24.         Thanks!
  25.  
  26.  
  27.         Procedure BoxText(Phrase : String; Row : Integer);
  28.  
  29.         These procedure places the specified text on the screen inside a
  30. box created with ASCII characters. It centers the text on the specified row
  31. and leaves a space at each end of the line of text.
  32.  
  33.                        BoxText('This is a sample',4)
  34.  
  35.         
  36.         Procedure EraseBox(Length, Row : Integer);
  37.  
  38.         These procedure erases the box drawn with BoxText. Unfortunatly, it
  39. is not "smart" and doesn't know where the last box was drawn so you have to
  40. put in the length of the phrase and the row.
  41.  
  42.                                EraseBox(15,4)
  43.  
  44.  
  45.         Procedure DrawBox(c1,r1,c2,r2:Integer);
  46.  
  47.         These procedure draws an ASCII box on the screen from the
  48. co-ordinates given.
  49.  
  50.                              DrawBox(2,2,12,24)
  51.  
  52.  
  53.         Procedure CenterText(Phrase : String; Row : Integer);
  54.  
  55.         These centers the specific phrase on the row given, without drawing
  56. a box around it.
  57.  
  58.                       CenterText('Anthoer Example',12)
  59.  
  60.  
  61.         Procedure KeyPressLoop;
  62.  
  63.         This procedure waits for a key to be pressed.
  64.  
  65.                                KeyPressLoop;
  66.  
  67.  
  68.         Procedure CursorOff;
  69.  
  70.         This turns the cursor off, making it invisible. If you use this in
  71. a program make sure you turn the cursor back on before exiting the program!
  72.  
  73.                                  CursorOff;
  74.  
  75.  
  76.         Procedure CursorOn;
  77.  
  78.         This turns the cursor back on, but it makes it a full cursor. (Like
  79. the ASCII character #219) but you can change that by changing the Regs.CL:=$7;
  80. to Regs.CL:=$1;
  81.  
  82.                                  CursorOn;
  83.  
  84.  
  85.  
  86.         Procedure DisplayTime(Column, Row : Integer);
  87.  
  88.         This displays the current system time at the specified row and
  89. column.
  90.  
  91.                              DisplayTime(2,23)
  92.  
  93.  
  94.         Function GetKey : Char;
  95.  
  96.         This function waits for a key to be pressed and then returns what
  97. it was. Great for asking a yes or no question and wanting to check whether
  98. the correct keys were pressed, or for a menu driven program.
  99.  
  100.                                key := GetKey
  101.  
  102.  
  103.         Function CheckDate(Arrive:String) : Boolean;
  104.  
  105.         This function checks to see if a date entered in MM/DD/YY is a
  106. valid date by checking weather the day number given is valid for the month
  107. given.
  108.  
  109.                        If CheckDate('mm/dd/yy') Then
  110.  
  111.  
  112.  
  113.         Function Eight(Temp_Arrive:String) : String;
  114.  
  115.         This function returns an eight character date when sent a shorter
  116. string. Example
  117.  
  118.                           NewDate:=Eight('1/1/92')
  119.  
  120.         Returns
  121.  
  122.                             NewDate = '01/01/92'
  123.  
  124.  
  125.         Function GetYear(Arrive:String):Integer;
  126.  
  127.         This function returns the year specified in a date entered in
  128. mm/dd/yy format.
  129.  
  130.                           Year:=GetYear('5/11/91')
  131.  
  132.         Returns
  133.  
  134.                                  Year = 91
  135.  
  136.  
  137.         Function LeadingZero(w: Word) : String;
  138.  
  139.         This function adds a leading zero to a number less then 10. It is a
  140. crucial part of the Display time procedure.
  141.  
  142.  
  143.         Function GetDayOfWeek(Year:Integer):Integer;
  144.  
  145.         This function gets the day of the week for January 1st of the given
  146. year and returns a number from 0 to 6. 0 = Sunday.
  147.  
  148.                            DOW:=GetDayOfWeek(92)
  149.  
  150.  
  151.         Function DayOfYear(Arrive:String):Integer;
  152.  
  153.         This function returns the number of the day of the year for a given
  154. date, including figuring out weather the date is in a leap year.
  155.  
  156.                          DOY:=DayOfYear('5/11/92')
  157.  
  158.  
  159.  
  160.