home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / pascal / IOFUNC.ZIP / YPRNT.TST < prev    next >
Encoding:
Text File  |  1986-04-12  |  4.5 KB  |  103 lines

  1. {           ╔═══╦══════════════════════════════════════════════╦═══╗
  2.             ║   ║         Pascal Library by Scott Wade         ║   ║
  3.             ║   ║           715 FM 1959      Apt 310           ║   ║
  4.             ║   ║           Houston, TX 77034                  ║   ║
  5.      ┌──────╨───╨──────────────────────────────────────────────╨───╨──────┐
  6.      │  This  group of routines is contributed to public domain,  and no  │
  7.      │  one can possibly get any commercial value out of them since they  │
  8.      │  must be used in other programs. I require that if these are used  │
  9.      │  as is in  any  program,  that this banner remain with the source  │
  10.      │  code of the program.  I would appreciate any comments or sugges-  │
  11.      │  tions on improvements, & am curious to hear how these are used.   │
  12.      │  You can leave a message for me on these BBS's:                    │
  13.      │          Ziggy's  821-1391         ScoreBoard  583-7848            │
  14.      │          TBL-COMM 661-9040         Test-Mode   660-9252            │
  15.      └────────────────────────────────────────────────────────────────────┘
  16. ■ YPRNT.LIB v1.0
  17.         CRT display library test program. this will test for  compatibility as
  18.         follows:
  19. ■ v1.0: 11/18/85 : Original. Prints the sentence on the CRT. If longer than 80
  20.         chars, will break at last space before 80. Will print the next sentence
  21.         after this one, not on next line down. wX is globally passed, so caller
  22.         cannot update it without massively trashing the visual effect on CRT.
  23.         This will hang if the line given to it has a string of characters with-
  24.         out spaces longer than 79 characters. Maybe someday I'll fix it.
  25.         But then again, maybe I won't.
  26. ■ v1.1: 12/13/85 : yCaps added. This will capitalize the first letter, then
  27.         add a period, then call yPrnt with the sentence. If OutLin ends in ^,
  28.         this will insert the . right before it, so the RET is unaffected.
  29. ■ v1.2: 2 /22/86 : yPrntI added. This will yPrnt an integer number in Just
  30.         spaces.
  31. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ Procedure Calls:
  32.    yPrnt( var wX : Integer; var OutLin : Buffer );
  33.    yCaps( var wX : Integer; var OutLin : Buffer );
  34.    yPrntI( var wX : Integer; Just, OutInt : Integer);}
  35.  
  36. Type
  37.    Buffer       =  string[ 255 ];
  38.    LongWord     =  string[  20 ];
  39.    Word         =  string[  10 ];
  40.    LongWordList =  array[ 1..16 ] of LongWord ;
  41.    WordList     =  array[ 1..16 ] of Word ;
  42.  
  43. { NOTE: all of the above are global types for INC and LIB files. }
  44. {$I yPrnt.LIB}
  45. var
  46.    wXX    :  integer ;
  47.    OotLin :  buffer  ;
  48. begin
  49.    GoToXY( 1,6 );
  50.    OotLin := '*****************************************^';
  51.    yPrnt( wXX, OotLin );
  52.    OotLin := '**   Test of the yPrnt Library v1.2    **^';
  53.    yPrnt( wXX, OotLin );
  54.    OotLin := '*****************************************^';
  55.    yPrnt( wXX, OotLin );
  56.    OotLin := '^'; yPrnt( wXX, OotLin );
  57.    OotLin := 'Above should be a nice neat box followed by a blank line, then this.^';
  58.    yPrnt( wXX, OotLin );
  59.    OotLin := 'This is a test line.';
  60.    yPrnt( wXX, OotLin );
  61.    OotLin := 'This should be on the same line, after a space.';
  62.    yPrnt( wXX, OotLin );
  63.    OotLin := '^';
  64.    yPrnt( wXX, OotLin );
  65.    OotLin := 'This should be on the next line down.^';
  66.    yPrnt( wXX, OotLin );
  67.  
  68.    OotLin := 'Here is a series of rather long lines intended to test the';
  69.    OotLin := OotLin + ' line break facility of yprnt.';
  70.    yPrnt( wXX, OotLin );
  71.  
  72.    OotLin := 'There should be no broken words and all of this should be';
  73.    OotLin := OotLin + ' neatly appended on    ';
  74.    yPrnt( wXX, OotLin );
  75.    OotLin := 'several lines without any weird spaces, blanks, returns, etc.';
  76.    yPrnt( wXX, OotLin );
  77.  
  78.    OotLin := 'Especially the phrase ''appended on several'' above,';
  79.    OotLin := OotLin + ' which has about 4 unneeded spaces after ''on''.';
  80.    OotLin := OotLin + '^';
  81.    yPrnt( wXX, OotLin );
  82.  
  83.    OotLin := 'this is a test of yCaps, which should capitalize the first';
  84.    OotLin := OotLin + ' word of this sentence and put a period after';
  85.    yCaps( wXX, OotLin );
  86.    OotLin := 'And this already has a period, so there is no need to add one.';
  87.    yCaps( wXX, OotLin );
  88.  
  89.    OotLin := 'Below are 3 integers. They should be each in a field 3 digits';
  90.    OotLin := OotLin + ' wide, padded with 1 space each:';
  91.    yPrnt( wXX, OotLin );
  92.    yPrntI( wXX, 3,127);
  93.    yPrntI( wXX, 3,27);
  94.    yPrntI( wXX, 3,7);
  95.  
  96.    OotLin := 'This concludes the test.^';
  97.    yPrnt( wXX, OotLin );
  98.    OotLin := '^';
  99.    yPrnt( wXX, OotLin );
  100. end.
  101.  
  102.  
  103.