Category : BASIC Source Code
Archive   : DWSCRN12.ZIP
Filename : DWSCRN.DOC

 
Output of file : DWSCRN.DOC contained in archive : DWSCRN12.ZIP
DavisWARE:Scrn v1.2
PowerBASIC Screen Effects Toolbox

For PowerBASIC 2.1f & 3.0a!

Written by James R. Davis
(C) Copyright 1993 - All Rights Reserved

Welcome to another unique library of tools for PowerBASIC that should come in
handy to generate all kinds of nifty screen effects for your system. First,
let me give you a run down of what this library will allow you to do. If
you've always wanted to do windowing type of stuff, but never knew how to get
started, this toolbox is for you. It contains all the basics for what you
need.

You should have the following files in this archive:

DWARE.DOC - A complete list of all DavisWARE available
DWSCRN.DOC - This documentation file
DWSCRN2F.EXE - PowerBASIC 2.10f version
DWSCRN3A.EXE - PowerBASIC 3.0a version
DWSRC.EXE - For registered versions
ORDER.FRM - Registration Order Form
READ.ME - A small text file which gives directions on the EXE's
DWSCRN.SRC - Data for DWSRC.EXE

If any of these files are missing please contact the Programmer's Mega-Source
BBS at (516) 737-4637 for an official copy.

There are 3 functions (FUN) and 24 subroutines (SUB). The difference between
a function and a subroutine is this; to use a subroutine you have to use the
CALL statement in version 2.1f of PB, otherwise you may remove the parenthesis
and use it like another command in version 3.0x of PB. Syntax for both ways
of calling the routines are given in each description. Whereas a function can
be used just like a variable. Here's a list of all the routines this library
contains:

Attr%() - Returns an attribute value for color specs passed.
Box() - Zooms new screen onto screen in an exploding box effect.
Clock() - Places new screen onto screen in a clockwise rotation.
Curtain() - Places new screen onto screen with a curtain effect.
Diagonal() - Places new screen onto screen in a diagonal sweep.
Diamond() - Explodes new screen onto screen in a diamond pattern.
FadeIn() - Fades new screen onto screen.
FadeOut() - Fades current screen off of screen, in color specified.
Fill() - Fills the entire screen with color and character.
GetScreen$ - Places the entire current screen into a variable.
GetWindow$() - Places a selective portion of current screen into a
variable.
Hole() - Explodes new screen onto screen in a circular pattern.
Lines() - Places new screen onto screen with vertical lines effect.
PutScreen() - Puts screen saved with GetScreen$ back on screen.
PutWindow() - Puts window saved with GetWindow$() back on screen.
Scrn2Str() - Small utility routine that will turn a screen into an
importable string for your programs.
SlideDownIn() - Slides new screen onto screen inwards from the top.
SlideDownOut() - Slides current screen down off screen, replacing with
screen given.
SlideLeftIn() - Slides new screen inwards from the left.
SlideLeftOut() - Slides current screen to the left off screen,
replacing with screen given.
SlideRightIn() - Slides new screen inwards from the right.
SlideRightOut() - Slides current screen to the right off screen,
replacing with screen given.
SlideUpIn() - Slides new screen inwards from the bottom.
SlideUpOut() - Slides current screen up and off screen,
replacing with screen given.
SplitHorzIn() - Slides new screen onto screen from top and bottom.
SplitHorzOut() - Splits current screen off screen up and down, replacing
with screen given.
SplitVertIn() - Slides new screen onto screen from left and right.
SplitVertOut() - Splits current screen off screen left and right,
by replacing with screen given.


Screens are passed to these routines as strings. This can be done a number of
ways. Each text screen contains 4000 characters (2 characters for each
position on the screen, first being the actual character and the second being
the color attribute for that character). To get a screen into a string you
can do one of the following:

þ Use the GetScreen$ command that will retrieve the current screen and
save it in a string for you (see definition of GetScreen$ below).

þ Use The Draw to generate your screen. Block the 25x80 area and save
the blocked portion using the binary method. Then, in your program you
can open the file as binary using the following example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,MyScreen$
CLOSE #1

This routine will place the screen saved in DEMO.BIN into the string
named MyScreen$. Look at the source code to DWDEMO enclosed with this
library for further details on this method.

þ Using Scrn2Str() you can create a bit of source code that is actually
a screen, that you can import directly into your program so that you
don't have to open a file all the time. Works very well.

These suggestions are yours to use at your disposal. Now on with the
definitions of the commands in this library.


-------------------------------------------------------------------------------
Attr%() FUN Returns color attribute value from passed color values.
-------------------------------------------------------------------------------
This function is a simple one in that it will return an integer value between
0 and 255 for the color values passed to it.

Syntax - PB 2.x: Atr% = Attr%(Fg%, Bg%)
(same for PB 3.x)

Where : Fg% = The foreground color to use (0-31)
Bg% = The background color to use (0-7)
Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
CALL PutScreen$(A$)
CALL FadeOut(Attr%(7,0))

See Also: FadeOut()


-------------------------------------------------------------------------------
Box() SUB Zooms new screen onto screen in an exploding box effect.
-------------------------------------------------------------------------------
This simple subroutine will place a screen specified onto the screen in an
exploding box effect. The effect is quite fast.

Syntax - PB 2.x: CALL Box(Scrn$)
Optional - PB 3.x: Box Scrn$

Where : Scrn$ = The screen to place on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
CALL Box(A$)

See Also: Curtain(), Diagonal(), Diamond(), Hole()

-------------------------------------------------------------------------------
Clock() SUB Places new screen onto screen in a clockwise rotation.
-------------------------------------------------------------------------------
This simple subroutine will place a screen specified onto the screen in a
rotating clockwise sweep.

Syntax - PB 2.x: CALL Clock(Scrn$)
Optional - PB 3.x: Clock Scrn$

Where : Scrn$ = The screen to place on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
CALL Clock(A$)

See Also: Curtain(), Diagonal(), Diamond(), Hole()


-------------------------------------------------------------------------------
Curtain() SUB Places new screen onto screen with a curtain effect.
-------------------------------------------------------------------------------
This subroutine will place a screen specified onto the screen in an opening
curtain type of effect.

Syntax - PB 2.x: CALL Curtain(Scrn$)
Optional - PB 3.x: Curtain Scrn$

Where : Scrn$ = The screen to place on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
CALL Curtain(A$)

See Also: Clock(), Diagonal(), Diamond(), Hole()


-------------------------------------------------------------------------------
Diagonal() SUB Places new screen onto screen in a diagonal sweep.
-------------------------------------------------------------------------------
This subroutine will place a screen specified onto the screen in a sweeping
diagonal effect from the top left corner of the screen to the bottom right
corner.

Syntax - PB 2.x: CALL Diagonal(Scrn$)
Optional - PB 3.x: Diagonal Scrn$

Where : Scrn$ = The screen to place on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
CALL Diagonal(A$)

See Also: Clock(), Curtain(), Diamond(), Hole()


-------------------------------------------------------------------------------
Diamond() SUB Explodes new screen onto screen in a diamond pattern.
-------------------------------------------------------------------------------
This subroutine will explode a screen specified onto the screen in expanding
diamond shape pattern.

Syntax - PB 2.x: CALL Diamond(Scrn$)
Optional - PB 3.x: Diamond Scrn$

Where : Scrn$ = The screen to place on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
CALL Diamond(A$)

See Also: Clock(), Curtain(), Diagonal(), Hole()


-------------------------------------------------------------------------------
FadeIn() SUB Fades new screen onto screen.
-------------------------------------------------------------------------------
This routine will fade a screen specified onto the screen in a random pattern.

Syntax - PB 2.x: CALL FadeIn(Scrn$)
Optional - PB 3.x: FadeIn Scrn$

Where : Scrn$ = The screen to place on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
CALL FadeIn(A$)

See Also: FadeOut()


-------------------------------------------------------------------------------
FadeOut() SUB Fades current screen off of screen, in color specified.
-------------------------------------------------------------------------------
This routine works just the opposite of FadeIn(). This routine will fade off
the entire screen in the color you specify.

Syntax - PB 2.x: CALL FadeOut(Atr%)
Optional - PB 3.x: FadeOut FG%,BG%

Where : Atr% = The color attribute to use

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
CALL PutScreen$(A$)
CALL FadeOut(Attr%(7,0))

See Also: Attr%(), FadeIn()


-------------------------------------------------------------------------------
Fill() SUB Fills current screen with color and character given.
-------------------------------------------------------------------------------
This routine will allow you to fill the entire screen with a color attribute
and character instantly.

Syntax - PB 2.x: CALL Fill(Atr%,Ch$)
Optional - PB 3.x: Fill Atr%,Ch$

Where : Atr% = The color attribute to use
Ch$ = The character to use
Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
CALL PutScreen$(A$)
CALL Fill(Attr%(7,1),"±")

See Also: Attr%()


-------------------------------------------------------------------------------
GetScreen$ FUN Places the entire current screen into a variable.
-------------------------------------------------------------------------------
This is a simple function that will allow you to place the entire current
screen into a single string of 4000 characters.

Syntax - PB 2.x: Scrn$ = GetScreen$
(same for PB 3.x)

Example:

COLOR 14,1
CLS
LOCATE 13,35
PRINT "This is the entire screen!"
A$ = GetScreen$
OPEN "O",1,"DEMO.BIN"
PRINT #1,A$
CLOSE

See Also: PutScreen()


-------------------------------------------------------------------------------
GetWindow$() FUN Places a selective portion of current screen into a
-------------------------------------------------------------------------------
This function is similair to GetScreen$ only it will grab only a portion of
the screen you specify in Upper-Left, and Lower-Right corners, and save it in
a specially formatted string. Use PutWindow() to replace the window back
where it belongs. The special string format is laid out in the following
manner:

Pos Len Description
--- --- -----------
1 1 ASCII value of the Upper-Left Row.
2 1 ASCII value of the Upper-Left Column.
3 1 ASCII value of the width of the window.
4+ Var The screen contents.

Syntax - PB 2.x: A$ = GetWindow$(ULR%,ULC%,LRR%,LRC%)

Where : ULR% = Upper-Left Row
ULC% = Upper-Left Column
LRR% = Lower-Right Row
LRC% = Lower-Right Column

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
CALL PutScreen$(A$)
Scrn$ = GetWindow$(10,5,20,65)
CLS
CALL PutWindow(Scrn$)

See Also: PutWindow()


-------------------------------------------------------------------------------
Hole() SUB Explodes new screen onto screen in a circular pattern.
-------------------------------------------------------------------------------
This subroutine will explode a screen specified onto the screen in expanding
circle shape pattern.

Syntax - PB 2.x: CALL Hole(Scrn$)
Optional - PB 3.x: Hole Scrn$

Where : Scrn$ = The screen to place on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
CALL Hole(A$)

See Also: Clock(), Curtain(), Diagonal(), Diamond()


-------------------------------------------------------------------------------
Lines() SUB Fades new screen onto screen with vertical lines.
-------------------------------------------------------------------------------
This subroutine will fade a screen specified onto the screen with a verical
lines effect.

Syntax - PB 2.x: CALL Lines(Scrn$)
Optional - PB 3.x: Lines Scrn$

Where : Scrn$ = The screen to place on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
CALL Lines(A$)

See Also: FadeIn(), FadeOut()


-------------------------------------------------------------------------------
PutScreen() SUB Puts screen saved with GetScreen$ back on screen.
-------------------------------------------------------------------------------
This routine is used to instantly replace a screen saved with GetScreen$.

Syntax - PB 2.x: CALL PutScreen(Scrn$)
Optional - PB 3.x: PutScreen Scrn$

Where : Scrn$ = The screen to replace on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
CALL PutScreen(A$)

See Also: GetScreen$


-------------------------------------------------------------------------------
PutWindow() SUB Puts window saved with GetWindow$() back on screen.
-------------------------------------------------------------------------------
This routine is used to instantly replace a window saved with GetWindow$().

Syntax - PB 2.x: CALL PutWindow(Scrn$)
Optional - PB 3.x: PutWindow Scrn$

Where : Scrn$ = The window to replace on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
CALL PutScreen(A$)
Mine$ = GetWindow$(10,5,20,65)
CLS
CALL PutWindow(Mine$)

See Also: GetWindow$()


-------------------------------------------------------------------------------
Scrn2Str() SUB Routine to turn a screen into an string.
-------------------------------------------------------------------------------
This is a special bonus routine to help out programmer's. With a call to this
simple routine, you can convert a screen saved with GetScreen$ into an
importable string that you can plug into your source code.

Syntax - PB 2.x: CALL Scrn2Str(Scrn$,File$,Var$)
Optional - PB 3.x: Scrn2Str Scrn$,File$,Var$

Where : Scrn$ = The screen to convert.
File$ = Is the name of the file to create. This may
contain drive and/or path information.
Var$ = Is the string variable to use.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
CALL Scrn2Str(A$,"C:\PATH\MYSCRN.BIN","Mine$")
END

(NOTE: The screen string will be created in MYSCRN.BIN which you can import
into your program by using the CTRL-KR command. The screen will look
something like this:

Mine$=Mine$+"asdl"+CHR$(10,34)+"fa;ldsjf;alskjfd;laskjf;alf"
Mine$=Mine$+CHR$(12,34,10)+"diuy931874asdl"+CHR$(12,34,10)+"fa;"
...
Mine$=Mine$+";lkdjf;lkjdfhgasdl"+CHR$(10,34)+"lskjfd;laskjf;alf"

Now if you want to place that string on the screen, just use the
PutWindow() command. It saves on having to load in the string from a file,
but also increases the size of source code... it's your call! I just
thought it was a good idea and stuck it in there!)


-------------------------------------------------------------------------------
SlideDownIn() SUB Slides new screen onto screen inwards from the top.
-------------------------------------------------------------------------------
This routine will slide the screen specified onto the screen from the top,
over the current screen.

Syntax - PB 2.x: CALL SlideDownIn(Scrn$)
Optional - PB 3.x: SlideDownIn Scrn$

Where : Scrn$ = The screen to place on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
Current$ = GetScreen$
CALL SlideDownIn(A$)
CALL SlideDownIn(Current$)

See Also: SlideDownOut()


-------------------------------------------------------------------------------
SlideDownOut() SUB Slides current screen down off screen.
-------------------------------------------------------------------------------
This routine will slide the current screen down off the screen revealing the
screen specified underneath.

Syntax - PB 2.x: CALL SlideDownOut(Scrn$)
Optional - PB 3.x: SlideDownOut Scrn$

Where : Scrn$ = The screen to reveal on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
Current$ = GetScreen$
CALL SlideDownOut(A$)
CALL SlideDownOut(Current$)

See Also: SlideDownIn()


-------------------------------------------------------------------------------
SlideLeftIn() SUB Slides new screen inwards from the left.
-------------------------------------------------------------------------------
This routine will slide the screen specified onto the screen from the left,
over the current screen.

Syntax - PB 2.x: CALL SlideLeftIn(Scrn$)
Optional - PB 3.x: SlideLeftIn Scrn$

Where : Scrn$ = The screen to place on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
Current$ = GetScreen$
CALL SlideLeftIn(A$)
CALL SlideLeftIn(Current$)

See Also: SlideLeftOut()


-------------------------------------------------------------------------------
SlideLeftOut() SUB Slides current screen to the left off screen.
-------------------------------------------------------------------------------
This routine will slide the current screen left off the screen revealing the
screen specified underneath.

Syntax - PB 2.x: CALL SlideLeftOut(Scrn$)
Optional - PB 3.x: SlideLeftOut Scrn$

Where : Scrn$ = The screen to reveal on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
Current$ = GetScreen$
CALL SlideLeftOut(A$)
CALL SlideLeftOut(Current$)

See Also: SlideLeftIn()


-------------------------------------------------------------------------------
SlideRightIn() SUB Slides new screen inwards from the right.
-------------------------------------------------------------------------------
This routine will slide the screen specified onto the screen from the right,
over the current screen.

Syntax - PB 2.x: CALL SlideRightIn(Scrn$)
Optional - PB 3.x: SlideRightIn Scrn$

Where : Scrn$ = The screen to place on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
Current$ = GetScreen$
CALL SlideRightIn(A$)
CALL SlideRightIn(Current$)

See Also: SlideRightOut()


-------------------------------------------------------------------------------
SlideRightOut() SUB Slides current screen to the right off screen.
-------------------------------------------------------------------------------
This routine will slide the current screen right off the screen revealing the
screen specified underneath.

Syntax - PB 2.x: CALL SlideRightOut(Scrn$)
Optional - PB 3.x: SlideRightOut Scrn$

Where : Scrn$ = The screen to reveal on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
Current$ = GetScreen$
CALL SlideRightOut(A$)
CALL SlideRightOut(Current$)

See Also: SlideRightIn()


-------------------------------------------------------------------------------
SlideUpIn() SUB Slides new screen inwards from the bottom.
-------------------------------------------------------------------------------
This routine will slide the screen specified onto the screen from the bottom,
over the current screen.

Syntax - PB 2.x: CALL SlideUpIn(Scrn$)
Optional - PB 3.x: SlideUpIn Scrn$

Where : Scrn$ = The screen to place on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
Current$ = GetScreen$
CALL SlideUpIn(A$)
CALL SlideUpIn(Current$)

See Also: SlideUpOut()


-------------------------------------------------------------------------------
SlideUpOut() SUB Slides current screen up and off screen.
-------------------------------------------------------------------------------
This routine will slide the current screen up off the screen revealing the
screen specified underneath.

Syntax - PB 2.x: CALL SlideUpOut(Scrn$)
Optional - PB 3.x: SlideUpOut Scrn$

Where : Scrn$ = The screen to reveal on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
Current$ = GetScreen$
CALL SlideUpOut(A$)
CALL SlideUpOut(Current$)

See Also: SlideUpIn()


-------------------------------------------------------------------------------
SplitHorzIn() SUB Slides new screen onto screen from top and bottom.
-------------------------------------------------------------------------------
This routine will slide two halves of the screen specified onto the screen
from the bottom and the top, over the current screen.

Syntax - PB 2.x: CALL SplitHorzIn(Scrn$)
Optional - PB 3.x: SplitHorzIn Scrn$

Where : Scrn$ = The screen to place on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
Current$ = GetScreen$
CALL SplitHorzIn(A$)
CALL SplitHorzIn(Current$)

See Also: SplitHorzOut()


-------------------------------------------------------------------------------
SplitHorzOut() SUB Splits current screen off screen up and down.
-------------------------------------------------------------------------------
This routine will split the current screen in half and slide the two halves
the current screen up and down off the screen revealing the screen specified
underneath.

Syntax - PB 2.x: CALL SplitHorzOut(Scrn$)
Optional - PB 3.x: SplitHorzOut Scrn$

Where : Scrn$ = The screen to reveal on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
Current$ = GetScreen$
CALL SplitHorzOut(A$)
CALL SplitHorzOut(Current$)

See Also: SplitHorzIn()


-------------------------------------------------------------------------------
SplitVertIn() SUB Slides new screen onto screen from left and right.
-------------------------------------------------------------------------------
This routine will slide two halves of the screen specified onto the screen
from the left and the right, over the current screen.

Syntax - PB 2.x: CALL SplitVertIn(Scrn$)
Optional - PB 3.x: SplitVertIn Scrn$

Where : Scrn$ = The screen to place on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
Current$ = GetScreen$
CALL SplitVertIn(A$)
CALL SplitVertIn(Current$)

See Also: SplitVertOut()


-------------------------------------------------------------------------------
SplitVertOut() SUB Splits current screen off screen left and right.
-------------------------------------------------------------------------------
This routine will split the current screen in half and slide the two halves
the current screen left and right off the screen revealing the screen
specified underneath.

Syntax - PB 2.x: CALL SplitVertOut(Scrn$)
Optional - PB 3.x: SlideVertOut Scrn$

Where : Scrn$ = The screen to reveal on the screen.

Example:

OPEN "B",1,"DEMO.BIN"
GET$ 1,4000,A$
CLOSE #1
Current$ = GetScreen$
CALL SplitVertOut(A$)
CALL SplitVertOut(Current$)

See Also: SplitVertIn()


REGISTRATION
------------

This library is considered Shareware, and is not free. If you find that you
use this library often, a registration fee of $25.00 is required for it's
continued use. That will entitle you to the source code to the library so you
can modify to your hearts content. There are other routines in the library
that are not available without the source that are very powerful. Like a
millisecond DELAY routine, a routine that returns the the current video
segment and a few others. So registration is really worth it just for the
little extra routines! Use the ORDER.FRM included in this package and
indicate the amount shown above. You can order by VISA, MasterCARD, American
Express, Discover, Check, or Money Order.

If you don't feel like waiting for the U.S. postal service, you can call the
Programmer's Mega-Source at (516) 737-4637 and register your copy online with
a credit card. You'll get your serial number ALOT faster then by mail.

I hope you enjoy this library and find it worthy to add to your PowerBASIC
toolbox collection. Have fun with it and if you have any trouble, just call
the BBS number given above for complete technical support on-line! Until next
time!

-=> James "The Garf!" Davis! <=-



  3 Responses to “Category : BASIC Source Code
Archive   : DWSCRN12.ZIP
Filename : DWSCRN.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/