home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / FASTSC.ZIP / FAST.DOC < prev    next >
Encoding:
Text File  |  1989-06-30  |  32.2 KB  |  692 lines

  1.  
  2.  
  3.  
  4.  
  5.                                  FASTSCRN version 1.0
  6.  
  7.      The FASTSCRN unit (and the related FASTDEF unit) is designed to provide
  8.      simple and fast video control through the use of objects.  Some features
  9.      include: memory screens, option of selecting a color or using previous
  10.      color, snow avoidance, copying between screens, changing attributes, cursor
  11.      control, multiple video page support, and multiple video mode support.
  12.  
  13.      Section One: FASTSCRN Interface. . . . . . . . . . . . . . . . . . . . .  2
  14.      Section Two: FASTDEF Interface . . . . . . . . . . . . . . . . . . . . .  4
  15.      Section Three: ScreenObj Description . . . . . . . . . . . . . . . . . .  6
  16.           Rows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
  17.           Cols. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
  18.           LastRow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
  19.           LastCol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
  20.           ScrPtr. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
  21.           Init. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
  22.           Done. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  23.           Snow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  24.           ScreenPtr . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  25.           Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  26.           WriteV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  27.           WriteA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  28.           WriteAv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  29.           WriteC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  30.           WriteAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  31.           WriteCv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  32.           WriteACv. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  33.           Fill. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  34.           Attr. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  9
  35.           CharAt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  9
  36.           ColorAt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  9
  37.           Copy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  9
  38.           SetLasts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  9
  39.      Section Four: DisplayObj . . . . . . . . . . . . . . . . . . . . . . . . 10
  40.           ScreenType. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  41.           ScreenSnow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  42.           Page. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  43.           Init. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  44.           Snow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  45.           CurrentRows . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  46.           CurrentCols . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  47.           CurrentVideoMode. . . . . . . . . . . . . . . . . . . . . . . . . . 11
  48.           SetVideoMode. . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  49.           SetCursor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  50.           GetCursor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  51.           CursorOff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  52.           CursorOn. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  53.           WhereR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  54.           WhereC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  55.           GotoRC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  56.           UsePage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
  57.           DisplayPage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
  58.      Section Five: Examples . . . . . . . . . . . . . . . . . . . . . . . . . 13
  59.           Writing to the screen . . . . . . . . . . . . . . . . . . . . . . . 13
  60.                Centering. . . . . . . . . . . . . . . . . . . . . . . . . . . 13
  61.                Specifying colors. . . . . . . . . . . . . . . . . . . . . . . 13
  62.                Using LastRow and LastCol. . . . . . . . . . . . . . . . . . . 13
  63.           Copying to and from screens . . . . . . . . . . . . . . . . . . . . 14
  64.      Section Six: Public Domain . . . . . . . . . . . . . . . . . . . . . . . 15
  65.  
  66.      FASTSCRN documentation                                               Page 2
  67.  
  68.  
  69.      Section One: FASTSCRN Interface
  70.      ------------ ------------------
  71.  
  72.      ScreenObj =    Object
  73.                          Rows,Cols :    Byte;
  74.                          LastRow,
  75.                          LastCol   :    Byte;
  76.                          ScrPtr    :    Pointer;
  77.  
  78.                          Constructor Init;
  79.                          Destructor Done;
  80.  
  81.                          Function Snow:Boolean;
  82.                          Function ScreenPtr(Row, Col:Byte):Pointer;
  83.  
  84.                          Procedure Write(Row, Col:Byte; Color:Integer;
  85.                               St:String);
  86.                          Procedure WriteV(Row, Col:Byte;
  87.                               Color:Integer; St:String);
  88.                          Procedure WriteA(Row, Col:Byte;
  89.                               Color:Integer; Var St; Len:Byte);
  90.                          Procedure WriteAv(Row, Col:Byte;
  91.                               Color:Integer; Var St; Len:Byte);
  92.                          Procedure WriteC(Row, Col1, Col2:Byte;
  93.                               Color:Integer; St:String);
  94.                          Procedure WriteAC(Row, Col1, Col2:Byte;
  95.                               Color:Integer; Var St; Len:Byte);
  96.                          Procedure WriteCv(Row1, Row2, Col:Byte;
  97.                               Color:Integer; St:String);
  98.                          Procedure WriteACv(Row1, Row2, Col:Byte;
  99.                               Color:Integer; Var St; Len:Byte);
  100.  
  101.                          Procedure Fill(Row, Col, Rows, Cols:Byte;
  102.                               Color:Integer; Ch:Char);
  103.                          Procedure Color(Row, Col, Rows, Cols:Byte;
  104.                               Color:Integer; Ch:Char);
  105.  
  106.                          Function CharAt(Row, Col:Byte):Char;
  107.                          Function ColorAt(Row, Col:Byte):Byte;
  108.  
  109.                          Procedure Copy(SourceScreen:ScreenObj;
  110.                               SourceRow, SourceCol, SourceRows,
  111.                               SourceCols, DestRow, DestCol:Byte);
  112.  
  113.                          Procedure SetLasts(Rows, Cols:Byte);
  114.                     End;
  115.  
  116.      DisplayObj=    Object (ScreenObj)
  117.                          ScreenType     :    Byte;
  118.                          ScreenSnow     :    Boolean;
  119.                          Page           :    Byte;
  120.  
  121.                          Constructor Init;
  122.  
  123.                          Function Snow:Boolean;
  124.  
  125.                          Function CurrentRows:Byte;
  126.                          Function CurrentCols:Byte;
  127.                          Function CurrentVideoMode:Byte;
  128.                          Procedure SetVideoMode(Mode:Byte);
  129.  
  130.      FASTSCRN documentation                                               Page 3
  131.  
  132.  
  133.                          Procedure SetCursor(Top,Bottom:Byte);
  134.                          Function GetCursor:Word;
  135.                          Procedure CursorOn;
  136.                          Procedure CursorOff;
  137.                          Function WhereR:Byte;
  138.                          Function WhereC:Byte;
  139.                          Function GotoRC(Row, Col:Byte);
  140.  
  141.                          Procedure UsePage(PageNum:Byte);
  142.                          Procedure DisplayPage(PageNum:Byte);
  143.                          Function CurrentPage:Byte;
  144.                     End;
  145.  
  146.      Var
  147.           DisplayScreen            :    DisplayObj;
  148.  
  149.      NOTE:The DisplayScreen variable is automatically set to the current video
  150.           display when your program is first run, therefore ALL writes to the
  151.           screen should go through DisplayScreen.
  152.  
  153.           Although not shown, ALL methods (except Constructors, of course) are
  154.           declared as VIRTUAL for easy extensibility.
  155.  
  156.      FASTSCRN documentation                                               Page 4
  157.  
  158.  
  159.      Section Two: FASTDEF interface
  160.      ------------ -----------------
  161.      Type
  162.           BorderTypes              =   (NoBrdr,
  163.                                         SpaceBrdr, SingleBrdr, DoubleBrdr,
  164.                                         HorizDoubleVertSingleBrdr,
  165.                                         HorizSingleVertDoubleBrdr,
  166.                                         BlockBrdr,
  167.                                         Hatch1Brdr, Hatch2Brdr, Hatch3Brdr,
  168.                                         SmallDotBrdr, MedDotBrdr, BigDotBrdr,
  169.                                         User1Brdr, User2Brdr, User3Brdr
  170.                                        );
  171.         Borders                   =   (HorizTop, HorizBottom,
  172.                                        VertLeft, VertRight, HorizBorders,
  173.                                        VertBorders, AllBorders);
  174.         BorderParts               =   (TL,TR,BL,BR,HT,HB,VR,VL,LC,RC,TC,BC,CC);
  175.  
  176.      The positions for these are as follows:
  177.           TL HT TC HT TR
  178.           VL          VR
  179.           LC HT CC HT RC
  180.           VL          VR
  181.           BL HB BC HB BR
  182.  
  183.      The mnemonics corrspond to the following:
  184.           TL   :    Top left corner
  185.           TR   :    Top right corner
  186.           BL   :    Bottom left corner
  187.           BR   :    Bottom right corner
  188.           HT   :    Horizontal top line
  189.           HB   :    Horizontal bottom line
  190.           VR   :    Vertical right line
  191.           VL   :    Vertical left line
  192.           LC   :    Left connecting piece
  193.           RC   :    Right connecting piece
  194.           TC   :    Top connecting piece
  195.           BC   :    Bottom connecting piece
  196.           CC   :    Center connecting piece
  197.  
  198.         BorderArray               =   Array[TL..CC] of Char;
  199.  
  200.      Const
  201.         Black                     =   $0;
  202.         Blue                      =   $1;
  203.         Green                     =   $2;
  204.         Cyan                      =   $3;
  205.         Red                       =   $4;
  206.         Magenta                   =   $5;
  207.         Brown                     =   $6;
  208.         LightGray                 =   $7;
  209.         DarkGray                  =   $8;
  210.         LightBlue                 =   $9;
  211.         LightGreen                =   $A;
  212.         LightCyan                 =   $B;
  213.         LightRed                  =   $C;
  214.         LightMagenta              =   $D;
  215.         Yellow                    =   $E;
  216.         White                     =   $F;
  217.         Blink                     =   $80;
  218.         BlackBG                   =   $0;
  219.  
  220.      FASTSCRN documentation                                               Page 5
  221.  
  222.  
  223.         BlueBG                    =   $10;
  224.         GreenBG                   =   $20;
  225.         CyanBG                    =   $30;
  226.         RedBG                     =   $40;
  227.         MagentaBG                 =   $50;
  228.         BrownBG                   =   $60;
  229.         LightGrayBG               =   $70;
  230.         SameAttr                  =   -1;
  231.         SameColor                 =   SameAttr;
  232.  
  233.         NoDisplay                 =   $0;
  234.         MDAmono                   =   $1;
  235.         CGAcolor                  =   $2;
  236.         DCC3                      =   $3;
  237.         EGAcolor                  =   $4;
  238.         EGAmono                   =   $5;
  239.         PGCcolor                  =   $6;
  240.         VGAmono                   =   $7;
  241.         VGAcolor                  =   $8;
  242.         DCC9                      =   $9;
  243.         DCC10                     =   $A;
  244.         MCGAmono                  =   $B;
  245.         MCGAcolor                 =   $C;
  246.         Unknown                   =   $FF;
  247.  
  248.         BorderSt                  :   Array [SpaceBrdr..User3Brdr] of
  249.                                       BorderArray=
  250.                                    ('█████████████', SpaceBrdr
  251.                                     '┌┐└┘──││├┤┬┴┼', SingleBrdr
  252.                                     '╔╗╚╝══║║╠╣╦╩╬', DoubleBrdr
  253.                                     '╒╕╘╛══││╞╡╤╧╪', HorizDoubleVertSingleBrdr
  254.                                     '╓╖╙╜──║║╟╢╥╙╫', HorizSingleVertDoubleBrdr
  255.                                     '▄▄▀▀▄▀▐▌▀▀▄▀■', BlockBrdr
  256.                                     '░░░░░░░░░░░░░', Hatch1Brdr
  257.                                     '▒▒▒▒▒▒▒▒▒▒▒▒▒', Hatch2Brdr
  258.                                     '▓▓▓▓▓▓▓▓▓▓▓▓▓', Hatch3Brdr
  259.                                     '·············', SmallDotBrdr
  260.                                     '∙∙∙∙∙∙∙∙∙∙∙∙∙', MedDotBrdr
  261.                                     #7#7#7#7#7#7#7#7#7#7#7#7#7, LargeDotBrdr
  262.                                     '             ', User1Brdr
  263.                                     '             ', User2Brdr
  264.                                     '             '); User3Brdr
  265.  
  266.      FASTSCRN documentation                                               Page 6
  267.  
  268.  
  269.      Section Three: ScreenObj description
  270.      -------------- ---------------------
  271.      The ScreenObj object type is used for in-memory screens.  Normally, an in-
  272.      memory screen is used to store information from the main-screen, modify it
  273.      in some way, and then re-display back onto the screen.
  274.  
  275.      Because ScreenObj assumes it is in-memory, no snow checks are made.
  276.  
  277.           ----------------------------------------------------------------------
  278.           Rows:Byte
  279.           ----------------------------------------------------------------------
  280.           The Rows variable contains the number of rows the ScreenObj contains.
  281.  
  282.  
  283.           ----------------------------------------------------------------------
  284.           Cols:Byte
  285.           ----------------------------------------------------------------------
  286.           The Cols variable contains the number of columns per row that the
  287.           ScreenObj contains.
  288.  
  289.  
  290.           ----------------------------------------------------------------------
  291.           LastRow:Byte
  292.           ----------------------------------------------------------------------
  293.           The LastRow variable is set to the row last written on.
  294.  
  295.           LastRow is updated by all ScreenObj.Write procedures (including array
  296.           writes, vertical writes, and centered writes), ScreenObj.Fill
  297.           procedure and ScreenObj.Attr procedure.
  298.  
  299.  
  300.           ----------------------------------------------------------------------
  301.           LastCol:Byte
  302.           ----------------------------------------------------------------------
  303.           The LastCol variable is set to the column last written on.
  304.  
  305.           LastCol is updated by all ScreenObj.Write procedures (including array
  306.           writes, vertical writes, and centered writes), ScreenObj.Fill
  307.           procedure and ScreenObj.Attr procedure.
  308.  
  309.  
  310.           ----------------------------------------------------------------------
  311.           ScrPtr:Pointer
  312.           ----------------------------------------------------------------------
  313.           ScrPtr points to the location in memory where the screen (either
  314.           memory screen or actual video display) begins.
  315.  
  316.  
  317.           ----------------------------------------------------------------------
  318.           Constructor Init
  319.           ----------------------------------------------------------------------
  320.           The Init constructor must be called prior to any activity on that
  321.           screen.  Init sets up the Virtual Method Table (VMT) as well as
  322.           initialized LastRow and LastCol to 1.
  323.  
  324.      FASTSCRN documentation                                               Page 7
  325.  
  326.  
  327.           ----------------------------------------------------------------------
  328.           Destructor Done
  329.           ----------------------------------------------------------------------
  330.           The Done destructor simply reclaims the memory used by the Virtual
  331.           Method Table (VMT).
  332.  
  333.  
  334.           ----------------------------------------------------------------------
  335.           Function Snow:Boolean
  336.           ----------------------------------------------------------------------
  337.           The ScreenObj.Snow function always returns False.
  338.  
  339.           This function will probably be eliminated in future releases of
  340.           FASTSCRN
  341.  
  342.  
  343.           ----------------------------------------------------------------------
  344.           Procedure Write(Row, Col, Color, StringToWrite)
  345.           ----------------------------------------------------------------------
  346.           Write will put StringToWrite at Row and Col on the ScreenObj.  Write
  347.           automatically takes care of the video page and snowing.
  348.  
  349.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  350.  
  351.  
  352.           ----------------------------------------------------------------------
  353.           Procedure WriteV(Row, Col, Color, StringToWrite)
  354.           ----------------------------------------------------------------------
  355.           WriteV will put StringToWrite VERTICALLY at Row and Col on the
  356.           ScreenObj.  WriteV automatically takes care of the video page and
  357.           snowing.
  358.  
  359.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  360.  
  361.  
  362.           ----------------------------------------------------------------------
  363.           Procedure WriteA(Row, Col, Color, ArrayToWrite, Len)
  364.           ----------------------------------------------------------------------
  365.           WriteA will put ArrayToWrite of length Len at Row and Col on the
  366.           ScreenObj.  WriteA automatically takes care of the video page and
  367.           snowing.
  368.  
  369.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  370.  
  371.  
  372.           ----------------------------------------------------------------------
  373.           Procedure WriteAv(Row, Col, Color, ArrayToWrite, Len)
  374.           ----------------------------------------------------------------------
  375.           WriteAv will put ArrayToWrite of length Len VERTICALLY at Row and Col
  376.           on the ScreenObj.  WriteA automatically takes care of the video page
  377.           and snowing.
  378.  
  379.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  380.  
  381.      FASTSCRN documentation                                               Page 8
  382.  
  383.  
  384.           ----------------------------------------------------------------------
  385.           Procedure WriteC(Row, Col1, Col2, Color, StringToWrite)
  386.           ----------------------------------------------------------------------
  387.           WriteC will put StringToWrite on the ScreenObj centered between Col1
  388.           and Col2.  WriteC automatically takes care of the video page and
  389.           snowing.
  390.  
  391.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  392.  
  393.  
  394.           ----------------------------------------------------------------------
  395.           Procedure WriteAC(Row, Col1, Col2, Color, ArrayToWrite, Len)
  396.           ----------------------------------------------------------------------
  397.           WriteAC will put ArrayToWrite of length Len on the ScreenObj centered
  398.           between Col1 and Col2.  WriteAC automatically takes care of the video
  399.           page and snowing.
  400.  
  401.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  402.  
  403.  
  404.           ----------------------------------------------------------------------
  405.           Procedure WriteCv(Row1, Row2, Col, Color, StringToWrite)
  406.           ----------------------------------------------------------------------
  407.           WriteCv will put StringToWrite on the ScreenObj centered VERTICALLY
  408.           between Row1 and Row2.  WriteCv automatically takes care of the video
  409.           page and snowing.
  410.  
  411.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  412.  
  413.  
  414.  
  415.           ----------------------------------------------------------------------
  416.           Procedure WriteACv(Row1, Row2, Col, Color, ArrayToWrite,
  417.                Len)
  418.           ----------------------------------------------------------------------
  419.           WriteACv (yes, you guessed it!) will put ArrayToWrite on the ScreenObj
  420.           centered VERTICALLY between Row1 and Row2.  WriteACv (maybe you can
  421.           guess this part also) automatically takes care of the video page and
  422.           snowing.
  423.  
  424.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  425.  
  426.  
  427.           ----------------------------------------------------------------------
  428.           Procedure Fill(Row, Col, Rows, Cols, Color, FillChar)
  429.           ----------------------------------------------------------------------
  430.           Fill fills the ScreenObj from Row and Col for Rows number of rows and
  431.           Cols number of columns with the FillChar using the color of Color.
  432.           Fill automatically takes care of the video page and snowing.
  433.  
  434.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  435.  
  436.  
  437.           ----------------------------------------------------------------------
  438.           Procedure Color(Row, Col, Rows, Cols, Color)
  439.           ----------------------------------------------------------------------
  440.           Color will color from Row, Col for Rows number of Rows and Cols number
  441.           of columns the color of Color.  Color automatically takes care of the
  442.           video page and snowing.
  443.  
  444.      FASTSCRN documentation                                               Page 9
  445.  
  446.  
  447.           ----------------------------------------------------------------------
  448.           Function CharAt(Row, Col):Char
  449.           ----------------------------------------------------------------------
  450.           CharAt returns the character at position Row, Col.
  451.  
  452.  
  453.           ----------------------------------------------------------------------
  454.           Function ColorAt(Row, Col):Byte
  455.           ----------------------------------------------------------------------
  456.           ColorAt returns the color at position Row, Col.
  457.  
  458.  
  459.  
  460.           ----------------------------------------------------------------------
  461.           Procedure SetLasts(Rows, Cols)
  462.           ----------------------------------------------------------------------
  463.           SetLasts sets the variables LastRow and LastCol.
  464.  
  465.           Should not normally be called by the program.
  466.  
  467.      FASTSCRN documentation                                              Page 10
  468.  
  469.  
  470.      Section Four: DisplayObj
  471.      ------------- ----------
  472.      The DisplayObj object type is used for displaying information on the
  473.      screen.  Full snow checking and prevention is done with this object.
  474.      Normally there is only one DisplayObj and that is DisplayScreen (which is
  475.      initialized in the start-up code for the FASTSCRN unit), although multiple
  476.      screens can be handled by declaring more DisplayObjs and some virtual
  477.      methods.
  478.  
  479.           ----------------------------------------------------------------------
  480.           ScreenType:Byte
  481.           ----------------------------------------------------------------------
  482.           The variable ScreenType is initialized when DisplayObj.Init is called.
  483.           The detected video screen is stored in this variable.
  484.  
  485.           Currently, ScreenType can only be one of the following values:
  486.                VGAcolor, VGAmono, EGAcolor, EGAmono, CGAcolor, CGAmono
  487.           Although only the above screen types are detected, FASTSCRN defines
  488.           the following screen types also:
  489.                MDAmono, DCC3, PGCcolor, DCC9, DCC10, MCGAmono, MCGAcolor
  490.  
  491.  
  492.           ----------------------------------------------------------------------
  493.           ScreenSnow:Boolean
  494.           ----------------------------------------------------------------------
  495.           This variable stores TRUE if the DisplayObj snows during memory
  496.           writes,  or FALSE if it does not.  It is set during the
  497.           DisplayObj.Init process.
  498.  
  499.  
  500.           ----------------------------------------------------------------------
  501.           Page:Byte
  502.           ----------------------------------------------------------------------
  503.           This variable stores the current video page.
  504.  
  505.           This value should never be accessed by a program, use DisplayPage and
  506.           UsePage instead.
  507.  
  508.  
  509.           ----------------------------------------------------------------------
  510.           Constructor Init
  511.           ----------------------------------------------------------------------
  512.           Call DisplayObj.Init prior to any access to the screen.  This routine
  513.           detects the following video cards:
  514.                CGA, VGA, and EGA
  515.           It also determines whether or not the screen is color or monochrome
  516.           and if it snows.
  517.  
  518.           Note:  The DisplayScreen variable is automatically Init at the
  519.           beginning of the program.
  520.  
  521.  
  522.           ----------------------------------------------------------------------
  523.           Function CurrentRows:Byte
  524.           ----------------------------------------------------------------------
  525.           This routine returns the number of rows on the screen.  It is
  526.           completely independant of ScreenObj.Rows.
  527.  
  528.      FASTSCRN documentation                                              Page 11
  529.  
  530.  
  531.           ----------------------------------------------------------------------
  532.           Function CurrentCols:Byte
  533.           ----------------------------------------------------------------------
  534.           This routine returns the number of columns on the screen.  It is
  535.           compoletely independant of ScreenObj.Cols.
  536.  
  537.  
  538.           ----------------------------------------------------------------------
  539.           Function CurrentVideoMode:Byte
  540.           ----------------------------------------------------------------------
  541.           This routine returns the current video mode.
  542.  
  543.  
  544.           ----------------------------------------------------------------------
  545.           Procedure SetVideoMode(Mode:Byte)
  546.           ----------------------------------------------------------------------
  547.           This routine sets the video mode to Mode.
  548.  
  549.  
  550.           ----------------------------------------------------------------------
  551.           Procedure SetCursor(Top, Bottom:Byte)
  552.           ----------------------------------------------------------------------
  553.           Sets the top scan line of the cursor to Top and the bottom scan line
  554.           to Bottom.
  555.  
  556.  
  557.           ----------------------------------------------------------------------
  558.           Function GetCursor:Word
  559.           ----------------------------------------------------------------------
  560.           Returns the top and bottom scan line of the cursor.  Hi(GetCursor) is
  561.           the Top and Lo(GetCursor) is the bottom.
  562.  
  563.  
  564.           ----------------------------------------------------------------------
  565.           Function WhereR:Byte
  566.           ----------------------------------------------------------------------
  567.           Returns the current row of the cursor.
  568.  
  569.  
  570.           ----------------------------------------------------------------------
  571.           Function WhereC:Byte
  572.           ----------------------------------------------------------------------
  573.           Returns of the current column of the cursor.
  574.  
  575.      FASTSCRN documentation                                              Page 12
  576.  
  577.  
  578.           ----------------------------------------------------------------------
  579.           Procedure UsePage(Page:Byte)
  580.           ----------------------------------------------------------------------
  581.           Directs all reads, writes, and cursor locating routines to the video
  582.           page, Page.
  583.  
  584.  
  585.           ----------------------------------------------------------------------
  586.           Procedure DisplayPage(Page:Byte)
  587.           ----------------------------------------------------------------------
  588.           Displays the video page, Page.
  589.  
  590.      FASTSCRN documentation                                              Page 13
  591.  
  592.  
  593.      Section Five: Examples
  594.      ------------- --------
  595.           Writing to the screen
  596.           ---------------------
  597.           Uses FastScrn, FastDef;
  598.  
  599.           Begin
  600.              With DisplayScreen Do Begin
  601.                 Fill(1,1,Rows,Cols,BlackBG+White,' ');
  602.                    (* Clears the screen and sets the using a black background
  603.                       and white foreground *)
  604.                 Write(1,1,BlackBG+White,'Hello');
  605.                    (* Places 'Hello' at row 1, column 1 in white letters on a
  606.                       black background *)
  607.                 Write(10,1,Red+DarkGrayBG,'world!');
  608.                    (* Places 'world!' at row 10, column 1 in red letters on a
  609.                       dark gray background *)
  610.              End;
  611.           End.
  612.  
  613.           Centering
  614.           ---------
  615.           Uses FastDef, FastScrn;
  616.  
  617.           Begin
  618.              With DisplayScreen Do
  619.                 WriteC(1, 1,Cols, BlackBG+White, 'Hello world!');
  620.                    (* Places 'Hello world!' centered between the first column
  621.                       and the last column on the screen *)
  622.           End.
  623.  
  624.  
  625.           SameColor/SameAttr
  626.           ------------------
  627.           Uses FastScrn, FastDef;
  628.  
  629.           Begin
  630.              With DisplayScreen Do Begin
  631.                 Color(1,1,Rows div 2,Cols,White+RedBG);
  632.                    (* Colors the top half of the screen with a white foreground
  633.                       and a red background *)
  634.                 Color((Rows div 2)+1,1,Rows div 2, Cols, BlackBG+Green);
  635.                    (* Colors the bottom half of the screen with a green
  636.                       forground and a black background *)
  637.                 WriteVC(1,Rows,Cols div 2,SameColor,'Hello world!');
  638.                    (* Centered vertically, 'Hello world!' appears, half in white
  639.                       on red and half in green on black *)
  640.              End;
  641.           End.
  642.  
  643.  
  644.           LastRow and LastCol
  645.           -------------------
  646.           Uses FastDef, FastScrn;
  647.  
  648.           Begin
  649.              With DisplayScreen Do Begin
  650.                 Write(1,1,SameColor,'Hello ');
  651.                 Write(LastRow, LastCol, SameColor, 'world!');
  652.  
  653.      FASTSCRN documentation                                              Page 14
  654.  
  655.  
  656.                    (* Places 'world!' next to 'Hello ' using the previous screen
  657.                       color *)
  658.              End;
  659.           End.
  660.  
  661.  
  662.           Copying to and from screens
  663.           ---------------------------
  664.           Uses FastScrn, FastDef;
  665.  
  666.           Var
  667.              MemoryScreen : ScreenObj;
  668.  
  669.           Begin
  670.              With MemoryScreen Do Begin
  671.                 Init;
  672.                 Rows:=10; Cols:=10;
  673.                 GetMem(ScrPtr, Rows*Cols*2);
  674.                    (* Get enough memory for the screen.  Multiply by 2 because
  675.                       each character on the screen consists of two bytes *)
  676.  
  677.                 Fill(1,1,Rows,Cols,White+BlueBG,'*');
  678.                    (* Fill MemoryScreen with astericks *)
  679.                 Write(1,1,SameColor,'This is the memory screen');
  680.                    (* Put 'This is the memory screen' into MemoryScreen in white
  681.                       on a blue background.          FastScrn automatically
  682.                       takes care of wrapping the text *)
  683.              End;
  684.  
  685.              With DisplayScreen Do Begin
  686.                 Fill(1,1,Rows,Cols,BlackBG+White,' ');
  687.                    (* Clear the screen *)
  688.                 Copy(MemoryScreen,1,1, MemoryScreen.Rows,MemoryScreen.Cols,
  689.                      1,15);
  690.                    (* Copies the memory screen to row 1, column 15 of the
  691.                       display screen *)
  692.              End;
  693.           End.
  694.  
  695.      FASTSCRN documentation                                              Page 15
  696.  
  697.  
  698.      Section Six: Public Domain
  699.      ------------ -------------
  700.           This software is hereby released into the public domain to do with it
  701.           as it will.  If you have any ideas for extending FASTSCRN or modifying
  702.           it in some way, I want to hear from you.  Also, if you have any
  703.           questions or comments about FASTSCRN, please let me know.
  704.  
  705.           Mark Addleman
  706.           [72777, 740]
  707.