home *** CD-ROM | disk | FTP | other *** search
- XtraDos Unit Documentation
- (c) 1992 Richard Morey
- Turbo Pascal v.6.0 is a Registered
- Trademark of Borland International
-
- I developed the procedures and functions in this unit out of need.
- I was working on a large program and their were things I need to do
- repeatedly, such as enclosing text in a box and centering it on the screen.
- Anyway, I've decided that maybe other people would like these procedures
- and functions as well, so here they are.
-
- If you find them useful and would like to see me develop more of
- them, please send a donation to:
-
- Richard Morey
- 131 East 23rd Street
- Apartment 10E
- New York, N.Y. 10010
-
- I can be reached on The Invention Factory BBS in NYC,
- (212)-274-8110 if you want to E-Mail me. If you have any ideas for
- procedures or functions you'd like to see, please let me know!
-
- Thanks!
-
-
- Procedure BoxText(Phrase : String; Row : Integer);
-
- These procedure places the specified text on the screen inside a
- box created with ASCII characters. It centers the text on the specified row
- and leaves a space at each end of the line of text.
-
- BoxText('This is a sample',4)
-
-
- Procedure EraseBox(Length, Row : Integer);
-
- These procedure erases the box drawn with BoxText. Unfortunatly, it
- is not "smart" and doesn't know where the last box was drawn so you have to
- put in the length of the phrase and the row.
-
- EraseBox(15,4)
-
-
- Procedure DrawBox(c1,r1,c2,r2:Integer);
-
- These procedure draws an ASCII box on the screen from the
- co-ordinates given.
-
- DrawBox(2,2,12,24)
-
-
- Procedure CenterText(Phrase : String; Row : Integer);
-
- These centers the specific phrase on the row given, without drawing
- a box around it.
-
- CenterText('Anthoer Example',12)
-
-
- Procedure KeyPressLoop;
-
- This procedure waits for a key to be pressed.
-
- KeyPressLoop;
-
-
- Procedure CursorOff;
-
- This turns the cursor off, making it invisible. If you use this in
- a program make sure you turn the cursor back on before exiting the program!
-
- CursorOff;
-
-
- Procedure CursorOn;
-
- This turns the cursor back on, but it makes it a full cursor. (Like
- the ASCII character #219) but you can change that by changing the Regs.CL:=$7;
- to Regs.CL:=$1;
-
- CursorOn;
-
-
-
- Procedure DisplayTime(Column, Row : Integer);
-
- This displays the current system time at the specified row and
- column.
-
- DisplayTime(2,23)
-
-
- Function GetKey : Char;
-
- This function waits for a key to be pressed and then returns what
- it was. Great for asking a yes or no question and wanting to check whether
- the correct keys were pressed, or for a menu driven program.
-
- key := GetKey
-
-
- Function CheckDate(Arrive:String) : Boolean;
-
- This function checks to see if a date entered in MM/DD/YY is a
- valid date by checking weather the day number given is valid for the month
- given.
-
- If CheckDate('mm/dd/yy') Then
-
-
-
- Function Eight(Temp_Arrive:String) : String;
-
- This function returns an eight character date when sent a shorter
- string. Example
-
- NewDate:=Eight('1/1/92')
-
- Returns
-
- NewDate = '01/01/92'
-
-
- Function GetYear(Arrive:String):Integer;
-
- This function returns the year specified in a date entered in
- mm/dd/yy format.
-
- Year:=GetYear('5/11/91')
-
- Returns
-
- Year = 91
-
-
- Function LeadingZero(w: Word) : String;
-
- This function adds a leading zero to a number less then 10. It is a
- crucial part of the Display time procedure.
-
-
- Function GetDayOfWeek(Year:Integer):Integer;
-
- This function gets the day of the week for January 1st of the given
- year and returns a number from 0 to 6. 0 = Sunday.
-
- DOW:=GetDayOfWeek(92)
-
-
- Function DayOfYear(Arrive:String):Integer;
-
- This function returns the number of the day of the year for a given
- date, including figuring out weather the date is in a leap year.
-
- DOY:=DayOfYear('5/11/92')
-
-
-
-