home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / pbc22b.zip / PBC$BAS.ZIP / CLRAREA.BAS < prev    next >
BASIC Source File  |  1993-01-01  |  1KB  |  38 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |        PBClone  Copyright (c) 1990-1993  Thomas G. Hanlin III        |
  4. '   |                                                                      |
  5. '   +----------------------------------------------------------------------+
  6.  
  7.    DECLARE FUNCTION Rand% (BYVAL Range%)
  8.    DECLARE SUB CalcSize (BYVAL TopRow%, BYVAL LeftCol%, BYVAL BottomRow%, BYVAL RightCol%, Elements%)
  9.    DECLARE SUB DelayV (BYVAL MilliSeconds%)
  10.    DECLARE SUB GetVidMode (BIOSMode%, ScreenWidth%, ActivePage%)
  11.    DECLARE SUB XQPrint (St$, BYVAL Row%, BYVAL Column%, BYVAL Attr%, BYVAL Page%, BYVAL Fast%)
  12.  
  13.    TYPE Posn
  14.       Row AS INTEGER
  15.       Col AS INTEGER
  16.    END TYPE
  17.  
  18. SUB ClearArea (TopRow%, LeftCol%, BottomRow%, RightCol%, Attr%, Fast%)
  19.    GetVidMode BIOSMode%, ScrWidth%, Page%
  20.    CalcSize TopRow%, LeftCol%, BottomRow%, RightCol%, ArraySize%
  21.    DIM Place(1 TO ArraySize%) AS Posn
  22.    tmp% = 1
  23.    FOR TRow% = TopRow% TO BottomRow%
  24.       FOR TCol% = LeftCol% TO RightCol%
  25.          Place(tmp%).Row = TRow%
  26.          Place(tmp%).Col = TCol%
  27.          tmp% = tmp% + 1
  28.       NEXT
  29.    NEXT
  30.    FOR tmp% = 1 TO ArraySize%
  31.       SWAP Place(tmp%), Place(Rand%(ArraySize%) + 1)
  32.    NEXT
  33.    FOR tmp% = 1 TO ArraySize%
  34.       XQPrint " ", Place(tmp%).Row, Place(tmp%).Col, Attr%, Page%, Fast%
  35.       DelayV 1
  36.    NEXT
  37. END SUB
  38.