Dec 142017
Windowing utility for Quick Basic 4. | |||
---|---|---|---|
File Name | File Size | Zip Size | Zip Type |
BASWIND4.BAS | 4924 | 1512 | deflated |
BASWIND4.DOC | 31903 | 10357 | deflated |
BASWIND4.OBJ | 4533 | 2255 | deflated |
FASTPRT.ASM | 5220 | 1174 | deflated |
FASTPRT.OBJ | 293 | 260 | deflated |
NEWVID.ASM | 4516 | 1016 | deflated |
NEWVID.OBJ | 347 | 301 | deflated |
TPCREAD.ME | 199 | 165 | deflated |
Download File BASWIND4.ZIP Here
Contents of the BASWIND4.DOC file
BASWIND4
(Modified to work with QB ver 4.0 by Bill Dickson 215-666-6554)
POP-UP WINDOWS FOR MICROSOFT QuickBASIC
by
Dave Evers
2500 Larch Rd. #58
Quincy, IL 62301
(217) 224-3615
About a year ago, I wrote a little merge routine for compiled
BASIC called BASWIND.MRG and placed it on a few bulletin boards
across the country. I was very pleasantly surprised by the al-
most immediate acceptance of this trivial program and the wide-
spread distribution accomplished via the bulletin board network.
I can't describe the thrill of signing onto a BBS for the very
first time, and finding a program that I wrote on it! Anyway,
I was very pleased by the response to the program.
It seems, however, that the timing of the introduction of
BASWIND was just slightly premature; because within a few weeks
of the release of the program, Microsoft introduced the first
major advance in the BASIC programming language in several
years: the QuickBASIC Compiler. The most important aspect of
this new programming environment was the ability to compile
subroutines separately from the main program, and join them
together at link time. This meant that you no longer had to
MERGE the BASWIND subroutine into your program and then use a
GOSUB to invoke it. Instead, you could use CALLs in your program
to perform the same function, and simply link the BASWIND module
to the program at the end of the compilation cycle.
About a dozen people wrote me with their modifications to the
BASWIND merge subroutine to turn it into a QuickBASIC module;
for which I am very grateful. With the newly structured routine,
I was able to build a library of useful functions which could be
linked into the program in a single step as needed. The product-
ivity of my programming increased rapidly with this development;
and I began to think of how to increase the usefulness of
BASWIND to take advantage of these new features. The only
remaining negative aspect of programming in this fashion was the
long EDIT-COMPILE-LINK-TRIAL-EDIT... process that is inherent
with this type of environment.
About that time, Microsoft pulled off another coup: the intro-
duction of QuickBASIC Version 2.0. If you do not have a copy of
this wonderful programming tool, go out and buy one IMMEDIATELY!
Microsoft has done for Compiled BASIC what Borland has done with
Turbo Pascal: you get an integrated editor and compiler, the
ability to compile into memory, and a powerful debugging
facility that detects both compile-time and run-time errors and
returns you to the editor at the spot in the program where your
(Now for QB ver 4.0)
1
error occurs. With this new programming environment, Compiled
BASIC is almost as simple to use as Interpreted BASIC; but with
all the power and flexibility of a compiler.
One of the nice features of the QuickBASIC Version 2.0 Compiler
is its ability to create libraries of program modules both for
stand-alone compilation and for use in the compile-to-memory
cycle which is so much more real-time and virtually interactive.
The secret to this is the User Library, which is a collection of
compiled modules in a format suitable for loading into memory
when you are compiling to memory. You can develop your program
in interactive fashion by compiling to memory and testing and
making necessary modifications; then when you are ready to
create your final stand-alone program, you link with another
library to produce your .EXE file.
All in all, the QuickBASIC Compiler allows you to develop a
collection of useful routines in a "toolbox" fashion; much as
you would with 'C' or Pascal. I immediately used this ability to
develop a number of routines based on BASWIND, and I am ready to
share them with you now.
USING BASWIND
Those of you who have been using BASWIND over the past year will
find that its use under QuickBASIC is almost exactly the same.
The only difference is that you invoke the routine by means of a
CALL with a list of parameters, rather than a GOSUB. The module
name is MAKEWIND; and its calling syntax is as follows:
CALL MAKEWIND(ULR%,ULC%,LRR%,LRC%,FRAME%,FORE%,BACK%,GROW%,NAME$)
Where:
ULR - (Upper Left-hand Row) - the screen row of the Upper
Left-hand corner of your desired window. Value
should be between 2 and 23 (for reasons explained
below). WARNING - the subroutine does not check for
proper values. You must check these yourself or ac-
cept the consequences.
ULC - (Upper Left-hand Column) - the screen column of the
Upper Left-hand corner. Value should be between 2
and 79.
LRR - (Lower Right-hand Row) - the screen row of the Low-
er Right-hand corner of your window. Value should
be greater than ULR but less than 23.
LRC - (Lower Right-hand Column) - The screen column loc-
2
ation of the Lower Right-hand corner. Value should
be greater than ULC but less than 79.
FRAME - A number between 0 and 4 indicating the type of
frame to be drawn around your window. Valid frame
values are:
0 - No Frame (just a border of BACKground
color.
1 - Single Line Frame
2 - Double Line Frame
3 - Single Horizontal Line, Double Vertical
Line Frame
4 - Single Vertical Line, Double Horizontal
Line Frame
NOTE: The frame is drawn * around * the window
coordinates specified in ULR,ULC,LRR, and
LRC. Thus, the dimensions of your window
will actually be two columns greater in
width (one on each side) and two rows
greater in length (top and bottom). This
is why you should make allowances in the
value of the window corners. Allowing the
frame to fall outside proper values will
cause unpredictable results.
FORE - The color of the frame in the window. Standard
color attributes are used (Black=0, Blue=1, etc.)
and valid values are 0 to 15.
BACK - The actual color of the window panel. The area de-
fined by the corners of the window will be cleared
to spaces in the background color specified. Val-
ues considered valid are 0 through 7.
GROW - A "switch" used to indicate to the subroutine if
the window should "grow" from a small box at the
midpoints of the coordinates to full size. A value
of 1 indicates the window should grow. A value of
0 indicates it should not. The "growing" illusion
is most effective for windows of medium size; and
is better suited to "wide" windows rather than
"tall" ones.
3
NAME$ - A character string that will serve as a label for
the window. The label will appear in the top line
of the frame on the left-hand side, enclosed by
square brackets ([ ]). If the length of the label
is greater than the width of the window, the label
will be omitted. The attributes for the label are
the same as for the window frame.
All of the above variables (with the exception of NAME$) must
either be declared globally as integers by means of a DEFINT
statement early in the program; or must have the specific
integer identifier (%) attached wherever they appear in the
program. The BASIC compiler is picky about this; so be sure to
verify that the type assignment is correct.
EXAMPLE
To produce a window with a blue background, a bright white
single line frame, and a label of "Ye Olde Window"; between col-
umns 20 and 60 and rows 4 to 20, the following statements would
be required:
100 ULC%=21:ULR%=5:LRC%=59:LRR%=19:FORE%=15:BACK%=1
110 FRAME%=1:GROW%=0:NAME$="Ye Olde Window"
120 CALL MAKEWIND(ULR%,ULC%,LRR%,LRC%,FRAME%,FORE%,
BACK%,GROW%,NAME$)
To generate a green window with a black single horizontal, dou-
ble vertical line frame; the following statements would be
needed:
4
200 ULC%=13:ULR%=3:LRC%=45:LRR%=15:FORE%=0:BACK%=2
210 FRAME%=3:GROW%=0:NAME$=""
220 CALL MAKEWIND(ULR%,ULC%,LRR%,LRC%,FRAME%,FORE%,
BACK%,GROW%,NAME$)
To "grow" a cyan panel in the middle of the screen with a yel-
low double line frame, the program would make the following
call:
300 ULC%=10:ULR%=5:LRC%=70:LRR%=19:FORE%=14:BACK%=3
310 FRAME%=2:GROW=1:NAME$=""
320 CALL MAKEWIND(ULR%,ULC%,LRR%,LRC%,FRAME%,FORE%,
BACK%,GROW%,NAME$)
One of the nicer advantages to the QuickBASIC Version 2.0
Compiler is that it allows you to use constants in the argument
list for a CALL. This means that you do not necessarily have to
pre-assign all parameters to variables and use the variables in
the CALL statement. For instance, the last example above would
be equivalent to the following CALL:
CALL MAKEWIND(10,5,19,70,2,14,3,1,"")
Of course, once the window is placed on the screen, it is up to
you to fill it with data by means of LOCATE, COLOR, and PRINT
statements. The above window calls only give you the canvas on
which to work. You, as the artist, produce the masterpiece on
your own.
ADVANCED WINDOWING FUNCTIONS
The basic BASWIND subroutine calls give you a fair amount of
flexibility in producing simple windows on the screen; but to
really add some "pizzazz" to your programs, you need more capab-
ility than just these humble beginnings.
Most programs which use windows make very effective use of the
screen by allowing a window to "pop on" to the screen over the
existing information, display some important data such as help
or statistics, and then "pop off" on demand; leaving the screen
data undisturbed. Obviously, the simple commands introduced ear-
lier would not be of use by themselves because they destroy the
information on the screen at the window coordinates. In order to
allow "non-destructive" windows on the screen, the contents of
the screen under the window must be saved prior to adding the
window, and then quickly restored when the window is removed.
Two additional commands, SCRNSAVE and SCRNREST, are used to ac-
complish this requirement. Obviously, SCRNSAVE causes the
contents of the screen to be saved; while SCRNREST restores that
data to the screen to effectively wipe out the window.
Using SCRNSAVE is quite easy.
EG: call scrnsave
5
in the program. When making the call to SCRNSAVE, you must
no longer make room in basic for the screen data!
10 ' dim(ing) an array no longer needed!
.
.
.
100 CALL SCRNSAVE 'New simplified call
Also, since the SCRNSAVE operation 'loses' the position of the
cursor, you should preserve it prior to making the call if you
need it as follows:
90 OLDX=CSRLIN:OLDY=POS(0)
The SCRNREST procedure is used in exactly the same way:
200 CALL SCRNREST 'New simplified call
and if necessary, the cursor position can be restored by using
the following statement:
210 LOCATE OLDX,OLDY
Scrolling and Clearing Data Inside a Window
Another powerful feature made possible by the BASWIND library is
the ability to scroll and clear a selected area of the screen,
independent of the rest of the data displayed. When combined
with the effective display techniques described above, this
impressive capability mimics that of expensive commercial
programs. And best of all, the function calls are as easy to use
as the routines described above for BASWIND.
The SCROLL command takes seven parameters; four of which are
already defined as ULC,ULR,LRC,LRR in the BASWIND window def-
inition and display routine. Since the frame of the window is
drawn around the area defined by these coordinates, the scrol-
ling can take place within the confines of these windows without
any further complications. The fifth parameter, the number of
lines to scroll, is easily set. Most often, it will only be one
line; so that another line can be set into its place either on
the top or the bottom depending on whether the scroll is up or
down. In the special case that the number of lines is zero, the
entire area is cleared with spaces of the background attribute;
so an easy way of clearing a window is available as well. The
sixth parameter determines the direction of the scroll; 1 for up
and -1 for down. The seventh is a new line, NEWMSG$, which will
be placed into the area left clear by the scroll procedure.
6
As with the BASWIND parameters above, all of the SCROLL vari-
ables must be integers. Thus, either a DEFINT statement must be
in place early in the program or the variables must carry the
"%" type identifier throughout the program.
The basic format of the scroll command is as follows:
CALL SCROLL(ULR%,ULC%,LRR%,LRC%,LINES%,DIR%,NEWMSG$)
The program statements required to scroll up the contents of a
window defined and displayed by BASWIND would be as follows:
100 LINES%=1:DIR%=1:NEWMSG$="This is a new line"
110 CALL SCROLL(ULR%,ULC%,LRR%,LRC%,LINES%,DIR%,NEWMSG$)
To scroll the same window down instead, the following series of
statements would be used:
100 LINES%=1:DIR%=-1:NEWMSG$="This is a new line"
110 CALL SCROLL(ULR%,ULC%,LRR%,LRC%,LINES%,DIR%,NEWMSG$)
And to clear the window of any data:
110 CALL SCROLL(ULR%,ULC%,LRR%,LRC%,0,1,"")
COMPILING PROGRAMS
As mentioned before, the routines in BASWIND are available only
in Compiled BASIC. DON'T TRY TO USE THESE PROGRAMS IN INTER-
PRETED BASIC!!!! At the very least, your computer will probably
lockup requiring a re-boot. At worst, your system could go
crazy, maybe even to the point of erasing data on disks in the
drive. You are forewarned!
BASWIND requires no special handling when it comes to compiling
your program. Just make certain that all of your variables
passing parameters to the BASWIND subroutine are identified as
integers, and you will be able to proceed with the compile
operation as with any other program.
The BASWIND4 package includes the modules for the BASWIND4,
NEWVID (SCRNSAVE, SCRNREST) and FASTPRT procedures in OBJ
form. This is done because some of the routines (in SCROLL)
require the use of the QB.LIB file distributed with
QuickBASIC. Since these are copyrighted, I cannot distribute
these routines in a Library form. You can, however, combine them
yourself by executing the following commands:
LINK /Q BASWIND4+NEWVID+FASTPRT+QB.LIB, QLIB.QLB,,BQLB40.LIB;
LIB QLIB.LIB+BASWIND4+NEWVID+FASTPRT+QB.LIB;
7
Creates User Lib's called qlib.qlb & qlib.lib that will be auto-
matically loaded when you invoke QuickBASIC with the command:
QB [filename] /Lqlib
If you create additional modules under QuickBASIC; you will want
to create a new version of the QLIB.qlb module. Simply add
the names of your object files to the list in the earlier
BUILDLIB command.
For those of you who would prefer to make standalone .EXE
programs using the BCOM40 library, I have also produced a
library called QLIB.LIB. This is the same group of modules
named above except compiled with the /O option for linking with
the BCOM40 library. When you compile your main program, you will
also have to use the /O switch. You will then need to link the
QLIB.QLB library to your program as follows:
LINK [filename],,,QLIB.LIB;
This will link together your program, the required qlib.lib
object code, and the BASWIND4 library.
ACKNOWLEDGEMENTS
One very key routine that is fundamental to the BASWIND4 library
is the FASTPRT routine. This is my modification of a program
that has been in circulation in the BBS community for some time.
It originally appeared in BYTE magazine as an enhancement for
Interpreted BASIC call QPRINT. I modified it to work with the
Compiler, and also to remove screen 'snow' on IBM Color Graphic
Adapters.
The SCRNSAVE and SCRNREST routines are also modified versions of
a routine from ADVBAS.LIB by Thomas Hanlin III. I modified them
as well to minimize any screen 'snow' on the CGA and for faster
operation using a routine by Augie Hansen described in the June
1986 issue of PC Tech Journal.
The rest of the routines (humble as they are) are my own
creation.
THE SHAPE OF THINGS TO COME
I mentioned earlier that the QuickBASIC environment is perfect
for the development of "toolbox" routines with which to be able
to build future programs. The BASWIND4 routines in this package
are a beginning to that toolbox effort; and using them, I have
written a number of useful tools that I have found invaluable in
my own programming. This brings me to a rather novel proposition
in the 'Shareware' community.
8
I was actually quite surprised when I found that quite a few
people around the country liked my original BASWIND program
enough to send me a contribution. It also led me to believe that
my programming also had value to other people. However, I am
just a little concerned by the overwhelmingly commercial atmos-
phere that has developed in the BBS community of late; where
everybody seems to be using the channel as a means of selling
their product rather than a free exchange of ideas. I was very
moved by the book "HACKERS", by Steven Levy which brought forth
the 'Hacker Ethic': That information and knowledge were there to
be shared, not bought and sold.
This puts me in somewhat of a quandry: First, if my programs
actually have value to people, I would like to benefit. However,
I have taken a great deal from the Public Domain world, and I
would like to feel that I have made my own contribution in some
small way by giving something back. Thus, I have come up with
what I figure is an equitable solution.
I have written a collection of 'medium-level' tools using the
'low-level' features of BASWIND4 to perform specific tasks for
'high-level' applications programs. These include:
POPMENU - a 'pop-up' menu in a window that allows
you to send it an array of choices, move
a highlighted 'menu bar' over these
choices using the cursor keys, and returns
your selection when you press [RETURN].
POPLIST - Similar to the pop-up menu above, but allows
you to send it a list of items, even more
than can fit within the window, and lets you
scroll all the way through it to pick out
your selection.
POPDIR - A special case of the POPLIST routine above.
You pass it a file spec (*.*, etc.) and it
returns with the directory in a list that
you can scroll through and select from.
TAGLIST - Another special case of the POPLIST routine.
Instead of scrolling through and picking one
selection from a list, this routine allows
you to 'tag' or 'untag' multiple selections
which are returned to your program in an
array.
TAGDIR - A special case of TAGLIST, which allows you
to tag or untag multiple filenames from the
directory.
BARMENU - A display similar to that of QuickBASIC V.
2's. A bar across the top tells you the basic
choices, and a moving 'pull-down' menu window
9
allows you to select choices from each of these
headings.
MENU123 - As the name implies, gives you menus similar
to those of LOTUS 123.
CALENDAR - Send it a month and a year, and get back a
calendar in a window.
CALENDR3 - Send it a month and a year, and get back
calendars for that month, the previous, and
the next month all in a window.
KEYCAL - Given a beginning month and year, a calendar
is displayed in a window; however, using the
cursor keys you can advance or back up through
the months and years to display the calendar
for any month of any year.
SAVEWIND
&
RESTWIND - Like SCRNSAVE and SCRNREST, except that they
work only for the area covered under the window
in question; thereby working much faster and
using far less memory.
*** PLUS MANY OTHERS ***
An additional file, wtest.exe, includes a complete demo of each
of the tools in the package.
THE FREE PART
In keeping with my desire to share these tools with the rest of
the BBS community, I am hereby committing that I will release
every one of these routines to the Public Domain. You have my
word that each of the routines described above will be donated
to the user community free of any requirements for reimburse-
ment or contributory payments. Approximately once a month, I
will release a new routine until all of them are available free
of charge. If you have patience, you can eventually collect
every one of them; and use them to your hearts content in any
program that you sell, give away, or pay people to use with my
blessing!
You will be responsible for finding them. I have found that the
original BASWIND program propogated quite quickly through the
BBS community; and these routines should do as well. The only
places that I can insure you will find them are the GEnie IBM
Roundtable and the Compuserve IBM Software SIG (this assuming
that the respective Sysops approve of these programs' distri-
bution by this method). I will try to upload them to as many
10
BBS' as I can, but due to horrendous long distance bills I can't
guarantee this.
These tools will be released as BWTOOLxx.ARC, where xx is a two
digit number. Thus you will be able to tell when a new one
arrives. The releases will only include the individual tools;
you will require this package (BASWIND4) for the fundamental
routines.
NOW THE PART THAT COSTS
To satisfy my other wish to keep food on the table, I make you
an alternative offer. For a contribution of $25, I will send you
a disk with every one of the routines listed above; so you can
begin using them right away. This disk will include the Source
Code to all of the routines so that you can modify them to suit
your own requirements. Payment of this $25 contribution gives
you full rights to the use of these programs in any application
that you write for use for yourself, your company, or to sell in
unlimited fashion. There are no more charges! It's yours to use
as you see fit!
To make things a little bit better, if you send me an IBM
formatted disk, in a self-addressed mailer with proper postage
attached, I will reduce the contribution to $20. Whether all
this is worth $5 to you is up to you... It definitely is worth
$5 bucks off to me!
So, the choice is up to you! If you choose to send in the con-
tribution, you will get immediate use of the routines. If you
choose to wait, you will ultimately get all of them for nothing.
I hope this is an acceptable means of accomplishing my desire to
contribute to the BBS community without sacrificing any real
value these programs might have.
Regardless of how you obtain these tools and how you use them,
please continue to support the BBS community by developing
routines and distributing them for other people to use and build
upon. I shudder to think where I would be today without the help
I have received on the various BBS' I inhabit. So if you write a
utility that you find useful, please consider making it avail-
able to the rest of us. The 'Hacker Ethic' remains as valid
today as it ever did. Please do your part to help support it.
Dave Evers
2500 Larch Rd. #58
Quincy, IL 62301
(217) 224-3615
GEnie Address: D.EVERS
Compuserve: 72456,2325
BIX: devers
DISCLAIMER OF LIABILITY
I, David Evers, as author of the BASWIND subroutine contained in
this package, hereby disclaim all responsibility for any con-
sequence arising from the use, misuse, or non-use of any of the
materials included herein. If this scares you and you feel that
you can't in good conscience use this product without deposits
and bonds and insurance policies for millions of dollars, THEN
DON'T USE THIS SOFTWARE. If you are afraid that use of this
product will damage your reputation, turn your green screen mon-
itor amber, change your house AC voltage from 110 to 220, or
make your hair fall out; THEN DON'T USE THIS SOFTWARE. And if by
chance YOU DO USE THIS SOFTWARE, and your spouse leaves you,
your hard disk crashes, and your modem begins playing "Yankee
Doodle", then it must have been some other software that caused
it; not mine!
December 14, 2017
Add comments