home *** CD-ROM | disk | FTP | other *** search
- { ╔═══╦══════════════════════════════════════════════╦═══╗
- ║ ║ Pascal Library by Scott Wade ║ ║
- ║ ║ 715 FM 1959 Apt 310 ║ ║
- ║ ║ Houston, TX 77034 ║ ║
- ┌──────╨───╨──────────────────────────────────────────────╨───╨──────┐
- │ This group of routines is contributed to public domain, and no │
- │ one can possibly get any commercial value out of them since they │
- │ must be used in other programs. I require that if these are used │
- │ as is in any program, that this banner remain with the source │
- │ code of the program. I would appreciate any comments or sugges- │
- │ tions on improvements, & am curious to hear how these are used. │
- │ You can leave a message for me on these BBS's: │
- │ Ziggy's 821-1391 ScoreBoard 583-7848 │
- │ TBL-COMM 661-9040 Test-Mode 660-9252 │
- └────────────────────────────────────────────────────────────────────┘
- ■ YPRNT.LIB v1.0
- CRT display library test program. this will test for compatibility as
- follows:
- ■ v1.0: 11/18/85 : Original. Prints the sentence on the CRT. If longer than 80
- chars, will break at last space before 80. Will print the next sentence
- after this one, not on next line down. wX is globally passed, so caller
- cannot update it without massively trashing the visual effect on CRT.
- This will hang if the line given to it has a string of characters with-
- out spaces longer than 79 characters. Maybe someday I'll fix it.
- But then again, maybe I won't.
- ■ v1.1: 12/13/85 : yCaps added. This will capitalize the first letter, then
- add a period, then call yPrnt with the sentence. If OutLin ends in ^,
- this will insert the . right before it, so the RET is unaffected.
- ■ v1.2: 2 /22/86 : yPrntI added. This will yPrnt an integer number in Just
- spaces.
- ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ Procedure Calls:
- yPrnt( var wX : Integer; var OutLin : Buffer );
- yCaps( var wX : Integer; var OutLin : Buffer );
- yPrntI( var wX : Integer; Just, OutInt : Integer);}
-
- Type
- Buffer = string[ 255 ];
- LongWord = string[ 20 ];
- Word = string[ 10 ];
- LongWordList = array[ 1..16 ] of LongWord ;
- WordList = array[ 1..16 ] of Word ;
-
- { NOTE: all of the above are global types for INC and LIB files. }
- {$I yPrnt.LIB}
- var
- wXX : integer ;
- OotLin : buffer ;
- begin
- GoToXY( 1,6 );
- OotLin := '*****************************************^';
- yPrnt( wXX, OotLin );
- OotLin := '** Test of the yPrnt Library v1.2 **^';
- yPrnt( wXX, OotLin );
- OotLin := '*****************************************^';
- yPrnt( wXX, OotLin );
- OotLin := '^'; yPrnt( wXX, OotLin );
- OotLin := 'Above should be a nice neat box followed by a blank line, then this.^';
- yPrnt( wXX, OotLin );
- OotLin := 'This is a test line.';
- yPrnt( wXX, OotLin );
- OotLin := 'This should be on the same line, after a space.';
- yPrnt( wXX, OotLin );
- OotLin := '^';
- yPrnt( wXX, OotLin );
- OotLin := 'This should be on the next line down.^';
- yPrnt( wXX, OotLin );
-
- OotLin := 'Here is a series of rather long lines intended to test the';
- OotLin := OotLin + ' line break facility of yprnt.';
- yPrnt( wXX, OotLin );
-
- OotLin := 'There should be no broken words and all of this should be';
- OotLin := OotLin + ' neatly appended on ';
- yPrnt( wXX, OotLin );
- OotLin := 'several lines without any weird spaces, blanks, returns, etc.';
- yPrnt( wXX, OotLin );
-
- OotLin := 'Especially the phrase ''appended on several'' above,';
- OotLin := OotLin + ' which has about 4 unneeded spaces after ''on''.';
- OotLin := OotLin + '^';
- yPrnt( wXX, OotLin );
-
- OotLin := 'this is a test of yCaps, which should capitalize the first';
- OotLin := OotLin + ' word of this sentence and put a period after';
- yCaps( wXX, OotLin );
- OotLin := 'And this already has a period, so there is no need to add one.';
- yCaps( wXX, OotLin );
-
- OotLin := 'Below are 3 integers. They should be each in a field 3 digits';
- OotLin := OotLin + ' wide, padded with 1 space each:';
- yPrnt( wXX, OotLin );
- yPrntI( wXX, 3,127);
- yPrntI( wXX, 3,27);
- yPrntI( wXX, 3,7);
-
- OotLin := 'This concludes the test.^';
- yPrnt( wXX, OotLin );
- OotLin := '^';
- yPrnt( wXX, OotLin );
- end.
-
-