home *** CD-ROM | disk | FTP | other *** search
- UNIT BlueBag;
-
- {This is a unit of handy procedures compiled for Turbo Pascal version 4.
- You have routines available for date arithmetic, modifying the cursor,
- CRT tricks, string processing, testing printer status, and multiple
- overlapping windows. The interface and dependencies are noted below
- together with an explanation of each routine.}
-
- INTERFACE
- USES Crt,DOS;
-
- TYPE
- DateType=STRING[6]; {'YrMoDy' format for date functions}
- CONST
- IsColor: BOOLEAN=True; {Display mode at startup}
- Single : BYTE=1; {Single and Double are the usual constants for drawing the}
- Double : BYTE=2; {box around the window.}
- RAM : BYTE = 0; {windows t/b saved to the heap}
- Disk : BYTE = 1; {windows t/b saved to logged disk}
-
- VAR
- StartScan,
- StopScan : BYTE; {Cursor shape at startup}
-
- PROCEDURE CLEAR(X1,Y1,X2,Y2:INTEGER);
- {Clears a section of the screen from X1,Y1 to X2,Y2}
- PROCEDURE CursorOn;
- {Sets cursor to default state}
- PROCEDURE CursorOff;
- {Turns off the cursor after saving its shape to Start/StopScan}
- FUNCTION IncDate(Base:DateType;Delta:LONGINT):DateType;
- {Incriments/decriments Base date by Delta days returning DateType}
- FUNCTION DaysBetween(Early,Late:DateType):LONGINT;
- {Returns the days between early and late dates as a longint}
- PROCEDURE DrawBox(X1,Y1,X2,Y2,LineStyle:BYTE);
- {Draws box defined by coordinate the parameters. LineStyle is Single,
- Double, or ASCII 32..254}
- FUNCTION IsBlank(TestStr:STRING):BOOLEAN;
- {Returns True if string is null or blank, False is at least 1 CHAR}
- PROCEDURE NoBlanks(VAR HasBlanks:STRING);
- {Removes all spaces from a string}
- FUNCTION OnFile(FileName:STRING):BOOLEAN;
- {Returns True if specified \path\filename exists, else False}
- FUNCTION PrinterOnLine(LPTnum:WORD):BOOLEAN;
- {Returns True if printer is on-line}
- PROCEDURE RestoreCursor;
- {Restores cursor to its shape before modification}
- PROCEDURE RestoreVideo;
- {Restores video attribute to status before ReverseVideo call}
- PROCEDURE ReverseVideo;
- {Displays text in reverse video}
- PROCEDURE SetCursor(ScanStart,ScanStop:BYTE);
- {You can set the cursor start and stop scan lines to alter the
- cursor shape. EG: SetCursor(0,StopScan) displays block cursor}
- PROCEDURE Space(Spaces:INTEGER);
- {Writes Spaces number of blanks to CRT}
- FUNCTION Trim(LongLine:STRING):STRING;
- {Removes leading and trailing blanks from a string}
- FUNCTION UpperCase(S:STRING):STRING;
- {Returns string in uppercase - (linked *.OBJ code)}
- PROCEDURE WAIT;
- {Turns off cursor, Prints "Press any key to continue", and waits
- for any key t/b touched before turing cursor back on.}
-
-
- {window procedures:}
-
- PROCEDURE OpenWindow(TX,TY,BX,BY,FRG,BKG,Border : BYTE;
- Heading : STRING;
- WhereSaved : BYTE);
- {Saves the previous video image within the square defined by
- TX,TY (top left) to BX,BY (bottom right) to RAM or DISK. A
- border of style BORDER (1,2,#32..254) is drawn in the FRG
- (TextColor) on BKG (TextBackground) colors and the HEADING
- is printed centered at the top of the box. A window is opened
- within the box and filled with BKG color.}
- PROCEDURE CloseWindow;
- {Closes the last window opened by OpenWindow and restores to pre-
- vious image. To close all the windows keep calling this procedure
- until they are all closed}
-
- Notes on windows:
- 10 windows can be open at any time (the natural screen plus nine
- "overlaid" windows). You can have some windows saved to RAM and others to
- DISK -- it doesn't matter; The CloseWindow procedure will find and restore
- the image automaticly.
- Do not mix these window procedures and the native TP Window() pro-
- cedure as you will not get the expected results.
-
-
- Please feel free to use and share this unit. I will be happy to send you
- the source code for this BlueBag.tpu and the AtSayGet.tpu for the small
- cost of $10.oo Canadian / $8.50 U.S. If you wish the code please WRITE to:
-
- (in Canada) (in U.S.A.)
-
- John Roncalio John Roncalio
- BlueRibbon Software BlueRibbon Software
- 34439 Ascott Avenue 603 Cherry Street, P.O. Box 432
- Abbotsford, B.C. Sumas, Washington
- V2S 4V6 98295