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.
- 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, and 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 yPrnt( var wX : Integer; var OutLin : Buffer ); {}
- var
- CRFlag, CRAfter : Boolean ;
- LineLng : Integer ;
- PartLin : Buffer ;
-
- Procedure yBreakit( var PartLin : Buffer ); {}
- var
- BreakAt, Loop : Integer ;
- begin
- BreakAt := 0;
- For Loop := 1 to (LineLng - wX) do
- If PartLin[ Loop ] = ' ' then BreakAt := Loop ;
- If BreakAt = 0 then CrFlag := True else
- PartLin := Copy( PartLin, 1, BreakAt - 1 );
- end{ yBreakit };
-
- begin{ yPrnt }
- LineLng := 81 ;
- CrFlag := False ;
- CRAfter := False ;
- While OutLin[ Length( OutLin )] = ' ' do
- Delete( OutLin, Length( OutLin), 1);
- While Length( OutLin ) > 0 do begin
- If OutLin[ Length( OutLin )] = '^' then begin
- CRAfter := True ;
- Delete( OutLin, Length( OutLin), 1)
- end{ If ^ };
- PartLin := OutLin ;
-
- If wX + Length( OutLin ) + 1 > Linelng then yBreakit( PartLin );{}
-
- If Not CrFlag then begin
- If wX > 1 then write( CON,' ');
- write( CON, PartLin );
- wX := wX + Length( PartLin ) + 1;
- Delete( OutLin, 1, Length(PartLin) + 1);
- end{ If Not CrFlag } else begin
- writeln( CON );
- wX := 1;
- crflag := false
- end{ If not CR else };
- end{ While };
- If CrAfter then begin
- writeln( CON );
- wX := 1;
- CrAfter := False ;
- end{ If CrAfter };
- end{ yPrnt };
-
- procedure yCaps( var wX : integer; var OutLin : Buffer );
- begin
- OutLin[ 1 ] := upcase( OutLin[ 1 ]);
- if OutLin[ Length( OutLin )] = '^' then begin
- If OutLin[ Length( OutLin )-1] <> '.' then
- Insert( '.', OutLin,Length( OutLin ));
- end else begin
- If OutLin[ Length( OutLin )] <> '.' then
- OutLin := OutLin + '.';
- end;
- yPrnt( wX, OutLin );
- end{ yCaps };
-
- procedure yPrntI( var wX: Integer ; Just, OutInt : Integer );
- var OutLin : Buffer ;
- begin
- Str( OutInt:Just, OutLin);
- yPrnt( wX, OutLin );
- end{ yPrntI };
-
- { yPrnt.LIB
- *****************************************************************************}