home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / pascal / PASLIBR.ZIP / CH2_2.DOC < prev    next >
Encoding:
Text File  |  1991-03-15  |  26.9 KB  |  1,154 lines

  1. ..pgno26
  2. ..foot60A2-##
  3. ..head02L──────────────────────────────────────────────────────────────────────
  4. ..head04L──────────────────────────────────────────────────────────────────────
  5. ..head03AGetScrn
  6. ■ Description
  7.  
  8.   Read the character and attribute bytes starting from specified
  9.   position on the screen into the buffer.
  10.  
  11.  
  12. ■ Summary
  13.  
  14.   Procedure GetScrn( x, y, NWords : Integer; Var Buffer );
  15.  
  16.  
  17.   x           column to begin reading data from the screen.
  18.  
  19.   y           row to begin reading data from the screen.
  20.  
  21.   NWords      number of words to read from the display screen.
  22.  
  23.   Buffer      data area where the data from the display screen will be
  24.               placed.
  25.  
  26.  
  27. ■ Remarks
  28.  
  29.   This procedure provides additional checks for vertical and
  30.   horizontal retrace periods on a CGA video adapter.  This is to
  31.   eliminate the snow effect that is produced from direct moves to or
  32.   from the video display.  These checks may be turned off through the
  33.   global variable CheckSnow.
  34.  
  35.  
  36. ■ See Also
  37.  
  38.   PutScrn
  39.  
  40. ■ Example
  41.  
  42.   Program Example;
  43.   Uses FPVideo;
  44.   Var
  45.      Buffer : Array[1..160] Of Char;
  46.   Begin
  47.      GetScrn( 1, 1, 80, Buffer );
  48.   End.
  49.  
  50.   In the above example the size of Buffer must be at least 160 bytes
  51.   long. A copy of row one on the screen will be placed into Buffer.
  52.   Buffer will contain both the character and attribute byte values for
  53.   each cell on the video display.
  54. ..page
  55. ..head03AGetVideoCols
  56. ■ Description
  57.  
  58.   Get the number of columns per line for the current display mode.
  59.  
  60.  
  61. ■ Summary
  62.  
  63.   Function GetVideoCols : Integer;
  64.  
  65.  
  66. ■ See Also
  67.  
  68.   GetVideoInfo
  69.  
  70.  
  71. ■ Example
  72.  
  73.   Program Example;
  74.   Uses FPVideo;
  75.   Begin
  76.      Writeln( 'Total number of columns = ', GetVideoCols:1 );
  77.   End.
  78.  
  79.   GetVidoCols should return either 40 or 80 depending on the video
  80.   mode the system is in.
  81. ..page
  82. ..head03AGetVideoInfo
  83. ■ Description
  84.  
  85.   Gets general video display informtion.
  86.  
  87.  
  88. ■ Summary
  89.  
  90.   Procedure GetVideoInfo( Var BaseSeg, Cols, Pg, Mode : Integer );
  91.  
  92.   BaseSeg     returns the base segment address of the current video
  93.               page.
  94.  
  95.   Cols        returns the number of display columns available for the
  96.               current video mode.
  97.  
  98.   Pg          returns the active display page for the video display.
  99.               This will always be zero for the monochrome display
  100.               adapter.
  101.  
  102.   Mode        returns the current video display mode.
  103.  
  104.  
  105. ■ See Also
  106.  
  107.   GetVideoCols, GetVideoMode, GetVideoPage
  108.  
  109.  
  110. ■ Example
  111.  
  112.   Program Example;
  113.   Uses FPVideo;
  114.   Var
  115.       BaseSeg,Mode,NCols,Pg : Integer
  116.   Begin
  117.      ClrWin( 1, 1, 80, 25, 7 );
  118.      GotoxyAbs( 1, 1 );
  119.  
  120.      GetVideoInfo( BaseSeg, NCols, Pg, Mode );
  121.  
  122.      Writeln('BaseSeg             = ', BaseSeg:1 );
  123.      Writeln('Number of columns   = ', NCols:1   );
  124.      Writeln('Active display page = ', Pg:1      );
  125.      Writeln('Current video mode  = ', Mode:1    );
  126.   End.
  127.  
  128.   This example will display the video information to the screen.  The
  129.   current video mode should return a value from 0-15, the number of
  130.   columns will be either 40 or 80, and the active video display page
  131.   will be a value from 0-7.
  132. ..page
  133. ..head03AGetVideoMode
  134. ■ Description
  135.  
  136.   Gets the current video mode.
  137.  
  138.  
  139. ■ Summary
  140.  
  141.   Function GetVideoMode : Integer;
  142.  
  143.  
  144. ■ Remarks
  145.  
  146.   Returns an integer giving the current video mode the system is in.
  147.   Use the guide on video modes under InitVideo.
  148.  
  149.  
  150. ■ See Also
  151.  
  152.   GetVideoInfo
  153.  
  154.  
  155. ■ Example
  156.  
  157.   Program Example;
  158.   Uses FPVideo;
  159.   Begin
  160.      Writeln( 'Current video mode  = ', GetVideoMode:1 );
  161.   End.
  162.  
  163.   This example will display the current video mode the system is in.
  164. ..page
  165. ..head03AGetVideoPage
  166. ■ Description
  167.  
  168.   Gets the active display page currently in use.
  169.  
  170.  
  171. ■ Summary
  172.  
  173.   Function GetVideoPage : Integer;
  174.  
  175.  
  176. ■ Remarks
  177.  
  178.   On monochrome displays GetVideoPage will always return a zero.
  179.  
  180.  
  181. ■ See Also
  182.  
  183.   GetVideoInfo
  184.  
  185.  
  186. ■ Example
  187.  
  188.   Program Example;
  189.   Uses FPVideo;
  190.   Begin
  191.      Writeln( 'Current video page  = ', GetVideoPage:1 );
  192.   End.
  193.  
  194.   This example will display the current video page on the system.  It
  195.   should be a value in the range of 0-7.
  196. ..page
  197. ..head03AGotoxyAbs
  198. ■ Description
  199.  
  200.   Position the cursor at the specified position on the screen without
  201.   regards to the global variables WindMin and WindMax.
  202.  
  203.  
  204. ■ Summary
  205.  
  206.   Procedure GotoxyAbs( x, y : Integer );
  207.  
  208.   x           column number to place the cursor in.
  209.  
  210.   y           row number to place the cursor in.
  211.  
  212.  
  213. ■ Remarks
  214.  
  215.   This procedure will place the cursor at the specified x,y
  216.   coordinates on the screen.  GotoxyAbs is NOT sensitive to the global
  217.   variables WindMin and WindMax.
  218.  
  219. ■ See Also
  220.  
  221.   WhereXAbs, WhereYAbs
  222.  
  223.  
  224. ■ Example
  225.  
  226.   Program Example;
  227.   Uses FPVideo;
  228.   Begin
  229.      WindowFP( 10, 10, 50, 24 );
  230.      GotoxyAbs( 1, 1 );
  231.   End.
  232.  
  233.   Even though the upper left corner of the defined window is row 10,
  234.   column 10, GotoxyAbs will still place the cursor in row 1 column 1
  235.   on the screen.
  236. ..page
  237. ..head03AHideCursor
  238. ■ Description
  239.  
  240.   Hides the cursor from view of the video display.
  241.  
  242.  
  243. ■ Summary
  244.  
  245.   Procedure HideCursor;
  246.  
  247.  
  248. ■ Remarks
  249.  
  250.   This function turns on the fifth bit of the current cursor size.
  251.  
  252.  
  253. ■ Example
  254.  
  255.   Program Example;
  256.   Uses FPVideo;
  257.   Begin
  258.      HideCursor();
  259.    End.
  260.  
  261.   This example will hide the cursor from view of the video display.
  262. ..page
  263. ..head03AInitVideo
  264. ■ Description
  265.  
  266.   Initialize the video mode.
  267.  
  268.  
  269. ■ Summary
  270.  
  271.   Procedure InitVideo( Mode : Integer );
  272.  
  273.   Mode        gives the video mode to initialize.
  274.  
  275.  
  276. ■ Remarks
  277.  
  278.   To set the screen to the appropriate video mode use the following
  279.   table as a guide.
  280.  
  281.      Mode           Type            Colors   Adapter
  282.    ───────────────────────────────────────────────────
  283.   |    0  |  Text - 40 x 25 B/W   |  b/w   |   CGA    |
  284.   |    1  |  Text - 40 x 25 COLOR |  16    |   CGA    |
  285.   |    2  |  Text - 80 x 25 B/W   |  b/w   |   CGA    |
  286.   |    3  |  Text - 80 x 25 COLOR |  16    |   CGA    |
  287.   |    4  |  Graphics - 320 x 200 |   4    |   CGA    |
  288.   |    5  |  Graphics - 320 x 200 | 4 grey |   CGA    |
  289.   |    6  |  Graphics - 640 x 200 |  b/w   |   CGA    |
  290.   |    7  |  Text - 80 x 25       |  16    |   MDA    |
  291.   |    8  |  Graphics - 160 x 200 |  16    |   PCjr   |
  292.   |    9  |  Graphics - 320 x 200 |  4,64  |   PCjr   |
  293.   |   10  |  Graphics - 640 x 200 |  16    | PCjr,EGA |
  294.   |   13  |  Graphics - 320 x 200 |  16    |   EGA    |
  295.   |   14  |  Graphics - 640 x 200 |  16    |   EGA    |
  296.   |   15  |  Graphics - 640 x 350 |   4    |   EGA    |
  297.    ───────────────────────────────────────────────────
  298.  
  299.  
  300. ■ Example
  301.  
  302.   Program Example;
  303.   Uses FPVideo;
  304.   Begin
  305.      InitVideo( 3 );
  306.    End.
  307.  
  308.   This example will initialize the video mode to 80 x 25 color text.
  309. ..page
  310. ..head03APutFrameAttr
  311. ■ Description
  312.  
  313.   Write the data in the buffer to the attribute byte in the specified
  314.   area on the screen.
  315.  
  316.  
  317. ■ Summary
  318.  
  319.   Procedure PutFrameAttr( x1, y1, x2, y2 : Integer; Var Buffer );
  320.  
  321.   x1          left column of window.
  322.  
  323.   y1          top row of window.
  324.  
  325.   x2          right column of window.
  326.  
  327.   y2          bottom row of window.
  328.  
  329.   Buffer      data buffer that contains the information to display on
  330.               the screen.
  331.  
  332.  
  333. ■ See Also
  334.  
  335.   GetFrameAttr, PutFrameCell, PutFrameChar
  336.  
  337.  
  338. ■ Example
  339.  
  340.   Program Example;
  341.   Uses FPVideo;
  342.   Var
  343.      Buffer : Array[1..2000] Of Char;
  344.   Begin
  345.      FillChar( Buffer, sizeof( Buffer ), 7 );
  346.      PutFrameAttr( 1, 1, 80, 25, Buffer );
  347.   End.
  348.  
  349.   In this example the first statment fills the buffer array with the
  350.   value of 7.  This will be the attribute character placed on the
  351.   screen for each attribute position.  Then the PutFrameAttr statement
  352.   places each byte in the buffer on the display screen.
  353.  
  354.   Normally PutFrameAttr is used as the inverse or complement of the
  355.   procedure GetFrameAttr.  Using GetFrameAttr would save the attribute
  356.   bytes for a section of the screen to be later restored with
  357.   PutFrameAttr.
  358. ..page
  359. ..head03APutFrameCell
  360. ■ Description
  361.  
  362.   Write the data in the buffer to the character and attribute bytes in
  363.   the specified area on the screen.
  364.  
  365.  
  366. ■ Summary
  367.  
  368.   Procedure PutFrameCell( x1, y1, x2, y2 : Integer; Var Buffer );
  369.  
  370.   x1          left column of window.
  371.  
  372.   y1          top row of window.
  373.  
  374.   x2          right column of window.
  375.  
  376.   y2          bottom row of window.
  377.  
  378.   Buffer      data buffer that contains the information to display on
  379.               the screen.
  380.  
  381.  
  382. ■ See Also
  383.  
  384.   GetFrameCell, PutFrameAttr, PutFrameChar
  385.  
  386.  
  387. ■ Example
  388.  
  389.   Program Example;
  390.   Uses FPVideo;
  391.   Var
  392.      Buffer : Array[1..2100] Of Char;
  393.      i      : Integer;
  394.   Begin
  395.      For i := 1 To 25 Do
  396.         FillRowCell( 1, i, 80, (i+64) Shl 8 + i );
  397.      GetFrameCell( 10, 10, 80, 25, Buffer );
  398.      ClrWin( 1, 1, 80, 25, 7 );
  399.      ColorMsg( 1, 1, 7, 'Press any key to continue...' );
  400.      i := GetKey;
  401.      PutFrameCell( 1, 1, 71, 16, Buffer );
  402.   End.
  403.  
  404.   In this example the first statment retrieves a section of the
  405.   display screen and places 2100 bytes in the data variable Buffer.
  406.   The screen is then cleared to remove the display data from the
  407.   screen.  PutFrameCell restores the data saved from GetFrameCell and
  408.   places the data onto another portion of the display screen.
  409. ..page
  410. ..head03APutFrameChar
  411. ■ Description
  412.  
  413.   Write the data in the buffer to the character byte in the specified
  414.   area on the screen.
  415.  
  416.  
  417. ■ Summary
  418.  
  419.   Procedure PutFrameChar( x1, y1, x2, y2 : Integer; Var Buffer );
  420.  
  421.   x1          left column of window.
  422.  
  423.   y1          top row of window.
  424.  
  425.   x2          right column of window.
  426.  
  427.   y2          bottom row of window.
  428.  
  429.   Buffer      data buffer that contains the information to display on
  430.               the screen.
  431.  
  432.  
  433. ■ See Also
  434.  
  435.   GetFrameChar, PutFrameAttr, PutFrameChar
  436.  
  437.  
  438. ■ Example
  439.  
  440.   Program Example;
  441.   Uses FPVideo;
  442.   Var
  443.      Buffer : Array[1..2000] Of Char;
  444.   Begin
  445.      FillChar( Buffer, sizeof( Buffer ), 'A' );
  446.      PutFrameChar( 1, 1, 80, 25, Buffer );
  447.   End.
  448.  
  449.   In this example the first statment fills the buffer array with the
  450.   letter A.  This will be the character to be placed on the screen for
  451.   each character position. Then the PutFrameChar statement places each
  452.   character from the buffer to the display screen.
  453.  
  454.   Normally PutFrameChar is used as the inverse of the GetFrameChar
  455.   procedure.  Using GetFrameChar would allow the character bytes for a
  456.   section of the screen to be saved and later restored with
  457.   PutFrameChar.
  458. ..page
  459. ..head03APutScrn
  460. ■ Description
  461.  
  462.   Displays the data in the buffer to the specified screen position in
  463.   character attribute byte form.
  464.  
  465.  
  466. ■ Summary
  467.  
  468.   Procedure PutScrn( x, y, NWords : Integer; Var Buffer );
  469.  
  470.   x           column to begin display of screen data.
  471.  
  472.   y           row to begin display of screen data.
  473.  
  474.   NWords      number of words to read from the display screen.
  475.  
  476.   Buffer      data buffer to place the screen information.
  477.  
  478.  
  479. ■ Remarks
  480.  
  481.   This procedure provides additional checks for vertical and
  482.   horizontal retrace periods on a CGA video adapter.  This is to
  483.   eliminate the snow effect that is produced from direct moves to or
  484.   from the video display.  These checks may be turned off through the
  485.   global variable CHECKSNOW.
  486.  
  487.  
  488. ■ See Also
  489.  
  490.   GetScrn
  491. ..page
  492. ■ Example
  493.  
  494.   Program Example;
  495.   Uses FPVideo;
  496.   Var
  497.      Buffer : Array[1..1920] Of Char;
  498.      i      : Integer;
  499.   Begin
  500.  
  501.      ClrWin( 1, 1, 80, 25, 7 );
  502.  
  503.      { place screen divider line in middle of screen }
  504.      FillRowChar( 1, 13, 80, '-' );
  505.  
  506.      { place characters and attributes to the screen }
  507.      For i := 14 To 25 Do
  508.         FillRowCell( 1, i, 80, (i+64) Shl 8 + i );
  509.  
  510.      { save the screen data }
  511.      GetScrn( 1, 14, 960, Buffer );
  512.  
  513.      ColorMsg( 1, 1, 7, 'Press any key to continue...' );
  514.      i := GetKey();
  515.  
  516.      { restore screen data to a different location }
  517.      PutScrn( 1, 1, 960, Buffer );
  518.   End.
  519.  
  520.   In this example the size of Buffer is 1920 bytes long. The 960 words
  521.   in the lower half of the screen are placed into the data buffer with
  522.   the call to GetScrn.  The call PutScrn will then place the data
  523.   buffer information on the screen starting at row one column one.
  524.   Both the attribute and character bytes will be written to the
  525.   screen.  The Buffer variable may be subscripted to use a different
  526.   starting point for the buffers contents.
  527. ..page
  528. ..head03ARvsAttr
  529. ■ Description
  530.  
  531.   Reverses the video attribute byte passed.
  532.  
  533. ■ Summary
  534.  
  535.   Function RvsAttr( Attr : Integer ) : Integer;
  536.  
  537.   Attr        value in the range 0-255 giving the screen color to be
  538.               reversed.
  539.  
  540.  
  541. ■ Remarks
  542.  
  543.   RvsAttr exchanges the three foreground and background attribute bits
  544.   of the parmaeter value passed in.  The blink and intensity bits of
  545.   the byte remain unchanged.
  546.  
  547.  
  548. ■ Example
  549.  
  550.   Foreground color --> white.
  551.   Background color --> black.
  552.  
  553.   If the above is true for the foreground and background colors then
  554.   after calling RvsAttr the foreground and background colors will be
  555.   as follows:
  556.  
  557.   Foreground color --> black.
  558.   Background color --> white.
  559.  
  560.  
  561.   Program Example;
  562.   Uses FPVideo;
  563.   Begin
  564.      Writeln( 'Attribute value 7 reversed = ', RvsAttr( 7 ):1 );
  565.   End.
  566. ..page
  567. ..head03AScrollDown
  568. ■ Description
  569.  
  570.   Scroll the specified portion of the screen down N lines filling in
  571.   new lines with spaces and the specified attribute.
  572.  
  573.  
  574. ■ Summary
  575.  
  576.   Procedure ScrollDown( x1, y1, x2, y2, Attr, NRows : Integer );
  577.  
  578.   x1          left column of window.
  579.  
  580.   y1          top row of window.
  581.  
  582.   x2          right column of window.
  583.  
  584.   y2          bottom row of window.
  585.  
  586.   Attr        value in the range 0-255. It defines the display
  587.               attribute to be used when filling in the blank lines at
  588.               the top of the window.
  589.  
  590.   NRows       number of lines the specified portion of the screen is
  591.               to be scrolled.
  592.  
  593.  
  594. ■ Remarks
  595.  
  596.   If you use a value of zero for the number of lines to scroll, the
  597.   window area defined by the x1,y1,x2,y2 coordinates will be cleared
  598.   to the color defined by the Attribute variable.
  599.  
  600.  
  601. ■ See Also
  602.  
  603.   ScrollLeft, ScrollRight, ScrollUp
  604. ..page
  605. ■ Example
  606.  
  607.   Program Example;
  608.   Uses FPVideo;
  609.   Var
  610.      i : Integer;
  611.   Begin
  612.      ClrWin( 1, 1, 80, 25, 7 );
  613.      For i := 1 To 25 Do
  614.         FillRowChar( 1, i, 80, Chr( 64+i ) );
  615.  
  616.      ScrollDown( 4, 5, 15, 20, 48, 1 );
  617.   End.
  618.  
  619.   In this example one line will be scrolled down in the window with
  620.   the top row being filled in with cyan on a Color/Graphics Adapter.
  621. ..page
  622. ..head03AScrollLeft
  623. ■ Description
  624.  
  625.   Scroll the specified portion of the screen left N columns filling in
  626.   new columns with spaces and the specified attribute.
  627.  
  628.  
  629. ■ Summary
  630.  
  631.   Procedure ScrollLeft( x1, y1, x2, y2, Attr, NCols : Integer );
  632.  
  633.   x1          left column of window.
  634.  
  635.   y1          top row of window.
  636.  
  637.   x2          right column of window.
  638.  
  639.   y2          bottom row of window.
  640.  
  641.   Attr        value in the range 0-255. It defines the display
  642.               attribute to be used when filling in the blank columns
  643.               on the right side of the window.
  644.  
  645.   NCols       number of columns the specified portion of the screen is
  646.               to be scrolled.
  647.  
  648.  
  649. ■ Remarks
  650.  
  651.   If you use a value of zero for the number of lines to scroll, the
  652.   window area defined by the x1,y1,x2,y2 coordinates will be cleared
  653.   to the color defined by the Attribute variable.
  654.  
  655.  
  656. ■ See Also
  657.  
  658.   ScrollDown, ScrollRight, ScrollUp
  659. ..page
  660. ■ Example
  661.  
  662.   Program Example;
  663.   Uses FPVideo;
  664.   Var
  665.      i : Integer;
  666.   Begin
  667.      ClrWin( 1, 1, 80, 25, 7 );
  668.      For i := 1 To 25 Do
  669.         FillRowChar( 1, i, 80, Chr( 64+i ) );
  670.      ScrollLeft( 4, 5, 15, 20, 48, 1 );
  671.   End.
  672.  
  673.   In this example one column will be scrolled left in the window with
  674.   the right column being filled in with cyan on a Color/Graphics
  675.   Adapter.
  676. ..page
  677. ..head03AScrollRight
  678. ■ Description
  679.  
  680.   Scroll the specified portion of the screen right N columns filling
  681.   in new columns with spaces and the specified attribute.
  682.  
  683.  
  684. ■ Summary
  685.  
  686.   Procedure ScrollRight( x1, y1, x2, y2, Attr, NCols : Integer );
  687.  
  688.   x1          left column of window.
  689.  
  690.   y1          top row of window.
  691.  
  692.   x2          right column of window.
  693.  
  694.   y2          bottom row of window.
  695.  
  696.   Attr        value in the range 0-255.  It defines the display
  697.               attribute to be used when filling in the blank columns
  698.               on the left side of the window.
  699.  
  700.   NCols       number of columns the specified portion of the screen is
  701.               to be scrolled.
  702.  
  703.  
  704. ■ Remarks
  705.  
  706.   If you use a value of zero for the number of lines to scroll, the
  707.   window area defined by the x1,y1,x2,y2 coordinates will be cleared
  708.   to the color defined by the Attribute variable.
  709.  
  710.  
  711. ■ See Also
  712.  
  713.   ScrollDown, ScrollLeft, ScrollUp
  714. ..page
  715. ■ Example
  716.  
  717.   Program Example;
  718.   Uses FPVideo;
  719.   Var
  720.      i : Integer;
  721.   Begin
  722.      ClrWin( 1, 1, 80, 25, 7 );
  723.      For i := 1 To 25 Do
  724.         FillRowChar( 1, i, 80, Chr( 64+i ) );
  725.      ScrollRight( 4, 5, 15, 20, 48, 1 );
  726.   End.
  727.  
  728.   In this example one column will be scrolled right in the window with
  729.   the left column being filled in with cyan on a Color/Graphics
  730.   Adapter.
  731. ..page
  732. ..head03AScrollUp
  733. ■ Description
  734.  
  735.   Scroll the specified portion of the screen up N lines filling in new
  736.   lines with spaces and the specified attribute.
  737.  
  738.  
  739. ■ Summary
  740.  
  741.   Procedure ScrollUp( x1, y1, x2, y2, Attr, NRows : Integer );
  742.  
  743.   x1          left column of window.
  744.  
  745.   y1          top row of window.
  746.  
  747.   x2          right column of window.
  748.  
  749.   y2          bottom row of window.
  750.  
  751.   Attr        value in the range 0-255. It defines the display
  752.               attribute to be used when filling in the blank lines at
  753.               the bottom of the window.
  754.  
  755.   NRows       number of lines the specified portion of the screen is
  756.               to be scrolled.
  757.  
  758.  
  759. ■ Remarks
  760.  
  761.   If you use a value of zero for the number of lines to scroll, the
  762.   window area defined by the x1,y1,x2,y2 coordinates will be cleared
  763.   to the color defined by the Attribute variable.
  764.  
  765.  
  766. ■ See Also
  767.  
  768.   ScrollDown, ScrollLeft, ScrollRight
  769. ..page
  770. ■ Example
  771.  
  772.   Program Example;
  773.   Uses FPVideo;
  774.   Var
  775.      i : Integer;
  776.   Begin
  777.      ClrWin( 1, 1, 80, 25, 7 );
  778.      For i := 1 To 25 Do
  779.         FillRowChar( 1, i, 80, Chr( 64+i ) );
  780.      ScrollUp( 4, 5, 15, 20, 48, 1 );
  781.   End.
  782.  
  783.   In this example one line will be scrolled up in the window with the
  784.   bottom row being filled in with cyan on a Color/Graphics Adapter.
  785. ..page
  786. ..head03ASetCursorSize
  787. ■ Description
  788.  
  789.   Set the size of the cursor.
  790.  
  791.  
  792. ■ Summary
  793.  
  794.   Procedure SetCursorSize( StScan, SpScan : Integer );
  795.  
  796.   StScan      starting scan line to be used for the cursor.
  797.  
  798.   SpScan      ending scan line to be used for the cursor.
  799.  
  800.  
  801. ■ Remarks
  802.  
  803.   The scan lines are numbered from zero at the top (StScan) to N at
  804.   the bottom (SpScan) where N applies to the following video adapters:
  805.  
  806.                 7 - Color/Graphics Adapter
  807.                14 - Monochrome Adapter
  808.  
  809.                - 0 --
  810.                - 1   |
  811.                - 2   |
  812.                - 3   |---> Scan lines for a Color/Graphics
  813.                - 4   |     display adapter.
  814.                - 5   |
  815.                - 6   |
  816.                - 7 --
  817.  
  818.  
  819. ■ See Also
  820.  
  821.   GetCursorSize
  822. ..page
  823. ■ Example
  824.  
  825.   The following examples are for the Color/Graphics Adapter:
  826.  
  827.  
  828.   Program Example;
  829.   Uses FPVideo;
  830.   Begin
  831.      SetCursorSize( 32, 32 );    { hides the cursor          }
  832.      SetCursorSize( 0 ,  7 );    { cursor covers entire cell }
  833.      SetCursorSize( 6 ,  7 );    { cursor size normal        }
  834.   End.
  835.  
  836.   The first SetCursorSize statment makes the cursor invisible on the
  837.   screen.  The second SetCursorSize will cover the entire character
  838.   cell on a color/graphic display and will cover half of the cell on a
  839.   monochrome display.  If the display was a monochrome display and the
  840.   entire character cell was to be covered by the cursor then the
  841.   parameters should be (0,13).
  842. ..page
  843. ..head03ASetVideoPage
  844. ■ Description
  845.  
  846.   Set the active display page.
  847.  
  848.  
  849. ■ Summary
  850.  
  851.   Procedure SetVideoPage( PageNo : Integer );
  852.  
  853.   PageNo      active display page to use.
  854.  
  855.  
  856. ■ Remarks
  857.  
  858.   Active display pages available for various display cards.
  859.  
  860.      0    - Monochrome
  861.      0-7  - Color/Graphics 40 column text mode
  862.      0-3  - Color/Graphics 80 column text mode
  863.      0    - Color/Graphics Hi Resolution Graphics mode
  864.  
  865.  
  866. ■ See Also
  867.  
  868.   GetVideoPage
  869.  
  870.  
  871. ■ Example
  872.  
  873.   The following examples are for the Color/Graphics Adapter because
  874.   the monochrome display only has one page available.
  875.  
  876.   Program Example;
  877.   Uses FPVideo;
  878.   Begin
  879.      SetVideoPage( 0 );  { default video page - page 1 }
  880.      SetVideoPage( 1 );  { another page       - page 2 }
  881.   End.
  882.  
  883.   The first statement will set the video display to the default
  884.   display page and the second statement will switch the video
  885.   display to page one.  This function is not intended for use with a
  886.   monochrome display adapter.
  887. ..page
  888. ..head03AShowCursor
  889. ■ Description
  890.  
  891.   Shows the cursor on the video display.
  892.  
  893.  
  894. ■ Summary
  895.  
  896.   Procedure ShowCursor;
  897.  
  898.  
  899. ■ Remarks
  900.  
  901.   This function turns off the fifth bit of the current cursor size.
  902.  
  903.  
  904. ■ Example
  905.  
  906.   Program Example;
  907.   Uses FPVideo;
  908.   Var
  909.      i : Integer;
  910.   Begin
  911.      HideCursor();
  912.      Writeln( 'Press any key to display the cursor' );
  913.      i := GetKey();
  914.      ShowCursor();
  915.    End.
  916.  
  917.   This example will hide the cursor from view of the video display
  918.   and then wait until the user presses a key.  Once a key has been
  919.   pressed the program will then turn the cursor back on.
  920. ..page
  921. ..head03AVioInit
  922. ■ Description
  923.  
  924.   Initializes the Video units global variables.
  925.  
  926.  
  927. ■ Summary
  928.  
  929.   Procedure VioInit;
  930.  
  931.  
  932. ■ Remarks
  933.  
  934.   This function must be executed once before any video functions can
  935.   be used.  If at some time you wish to reset the global variables to
  936.   their default settings you may use this procedure to complete that
  937.   task.
  938.  
  939.  
  940. ■ Example
  941.  
  942.   Program Example;
  943.   Uses FPVideo;
  944.   Begin
  945.      VioInit;      { do only if global video variables need }
  946.                    { to be reset.                           }
  947.   End.
  948.  
  949.   This example initializes the video display variables needed for the
  950.   video library routines.
  951. ..page
  952. ..head03AWhereXAbs
  953. ■ Description
  954.  
  955.   Returns the column the cursor is in.
  956.  
  957.  
  958. ■ Summary
  959.  
  960.   Function WhereXAbs : Integr;
  961.  
  962.  
  963. ■ Remarks
  964.  
  965.   This function will return an integer giving the column number the
  966.   cursor is on.  This routine is not sensitive to the currently
  967.   defined window.
  968.  
  969.  
  970. ■ See Also
  971.  
  972.   GotoxyAbs, WhereYAbs
  973.  
  974.  
  975. ■ Example
  976.  
  977.   Program Example;
  978.   Uses FPVideo;
  979.   Begin
  980.      Writlen( 'The cursor is in column ', WhereXAbs:1 );
  981.   End.
  982.  
  983.   The column number of the cursor when WhereXAbs was called will be
  984.   displayed to the screen.
  985. ..page
  986. ..head03AWhereYAbs
  987. ■ Description
  988.  
  989.   Returns the row the cursor is on.
  990.  
  991.  
  992. ■ Summary
  993.  
  994.   Function WhereYAbs : Integer;
  995.  
  996.  
  997. ■ Remarks
  998.  
  999.   This function will return an integer giving the row number the
  1000.   cursor is on.  This routine is not sensitive to the currently
  1001.   defined window.
  1002.  
  1003.  
  1004. ■ See Also
  1005.  
  1006.   GotoxyXAbs, WhereXAbs
  1007.  
  1008.  
  1009. ■ Example
  1010.  
  1011.   Program Example;
  1012.   Uses FPVideo;
  1013.   Begin
  1014.      Writeln( 'The cursor is in row ', WhereYAbs:1 );
  1015.   End.
  1016.  
  1017.   The row number of of the cursor when WhereYAbs was called will be
  1018.   displayed to the screen.
  1019. ..page
  1020. ..head03AWindowFP
  1021. ■ Description
  1022.  
  1023.   Set the window coordinate variables WindMin and WindMax.
  1024.  
  1025.  
  1026. ■ Summary
  1027.  
  1028.   Procedure WindowFP( x1, y1, x2, y2 : Integer );
  1029.  
  1030.   x1          left column of window.
  1031.  
  1032.   y1          top row of window.
  1033.  
  1034.   x2          right column of window.
  1035.  
  1036.   y2          bottom row of window.
  1037.  
  1038.  
  1039. ■ Remarks
  1040.  
  1041.   This function sets the window coordinates in the WindMin and WindMax
  1042.   global variables which FrameWin uses for framing windows on the
  1043.   display screen.
  1044.  
  1045.  
  1046. ■ See Also
  1047.  
  1048.   FrameWin
  1049.  
  1050.  
  1051. ■ Example
  1052.  
  1053.   Program Example;
  1054.   Uses FPVideo;
  1055.   Begin
  1056.      WindowFP( 1, 1, 80, 25 );
  1057.      FrameWin( 'L', 'R', 'l', 'r', 'h', 'v', 7 );
  1058.   End.
  1059.  
  1060.   This example will set the window coordinates to the upper left and
  1061.   lower right corners of the video display.
  1062. ..page
  1063. ..head03AWriteSt
  1064. ■ Description
  1065.  
  1066.   Display a string on the screen
  1067.  
  1068.  
  1069. ■ Summary
  1070.  
  1071.   Procedure WriteSt( St : String );
  1072.  
  1073.   St          string expression to display on screen.
  1074.  
  1075.  
  1076. ■ Remarks
  1077.  
  1078.   WriteSt positions the cursor after the newly displayed string.
  1079.   WriteSt is NOT sensitive to the currently defined window and will
  1080.   wrap around to the next row of column one of the physical screen
  1081.   when necessary. WriteSt will not scroll the screen if the data to be
  1082.   displayed is to extend beyond the last row of the screen.  WriteSt
  1083.   uses the attribute byte defined by the global variable TextAttr.
  1084.  
  1085.  
  1086. ■ See Also
  1087.  
  1088.   WriteStLn
  1089.  
  1090.  
  1091. ■ Example
  1092.  
  1093.   Program Example;
  1094.   Uses FPVideo;
  1095.   Var
  1096.      i : Integer;
  1097.   Begin
  1098.      GotoxyAbs( 1, 1 );      { position curor in upper left corner }
  1099.      For i := 1 To 49 Do
  1100.         WriteSt( 'test string ');
  1101.   End.
  1102.  
  1103.   This example will position the cursor in the upper left corner of
  1104.   the display screen and then will proceed to display the string "test
  1105.   string" fifty times.  Example of the intented output follows:
  1106.  
  1107.   test string test string test string test string ...
  1108. ..page
  1109. ..head03AWriteStln
  1110. ■ Description
  1111.  
  1112.   Display a string on the screen
  1113.  
  1114. ■ Summary
  1115.  
  1116.   Procedure WriteStln( St : String );
  1117.  
  1118.   St          string expression to display on screen.
  1119.  
  1120.  
  1121. ■ Remarks
  1122.  
  1123.   WriteStln positions the cursor in column one on the next line of the
  1124.   display screen after the data has been displayed.  WriteStln is NOT
  1125.   sensitive to the currently defined window and will wrap around to
  1126.   the next row of column one of the physical screen when necessary.
  1127.   WriteStln will not scroll the screen if the data to be displayed is
  1128.   to extend beyond the last row of the screen.  WriteStln uses the
  1129.   attribute byte defined by the global variable TextAttr.
  1130.  
  1131.  
  1132. ■ See Also
  1133.  
  1134.   WriteSt
  1135.  
  1136.  
  1137. ■ Example
  1138.  
  1139.   Program Example;
  1140.   Uses FPVideo;
  1141.   Var
  1142.      i : Integer;
  1143.   Begin
  1144.      GotoxyAbs( 1, 1 );      { position curor in upper left corner }
  1145.      For i := 1 To 24 Do
  1146.         WriteSt( 'test string ');
  1147.   End.
  1148.  
  1149.   This example will position the cursor in the upper left corner of
  1150.   the display screen and then on each line will display the string
  1151.   "test string" on the first 24 lines of the display.
  1152. ..page
  1153. 
  1154.