This is only a preview of the November 1994 issue of Silicon Chip. You can view 29 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "A Novel Alphanumeric Clock":
Items relevant to "80-Metre DSB Amateur Transmitter":
Items relevant to "Twin-Cell Nicad Discharger":
Articles in this series:
Articles in this series:
|
COMPUTER BITS
BY DARREN YATES
Visual BASIC for DOS
provides Windows-like
user interfaces
The Visual BASIC package includes two large manuals – one a programmer’s
guide & the other a command reference manual. The program also supports an
extensive on-line help system.
Designed to replace
Quick BASIC 4.5, this
DOS version of the
popular Windows
program will run all
QB4.5 & DOS’s QBasic
programs & allows you
to produce Windowslike user interfaces. But
is it that much of an
improvement?
Visual BASIC has certainly renewed
interest in a language which many
purists (read “C programmers”) had
previously dis
missed as a toy. It’s
certainly now the easiest way to create
Windows programs that run, look and
feel just like those expensive big-company applications.
However, reading through the reference manual and looking at all the
financial commands that are available,
you quickly get the feeling that it was
designed mainly with the economist in
mind. The lack of almost all hardware
control commands certainly hasn’t
endeared it to those of us who like to
plug bits and pieces into the back of
our PCs.
Many of you have read our “Computer Bits” series where we have made
use of Quick BASIC 4.5. Although it
may be a good language and used by
many small businesses, Microsoft’s
decision to no longer support it probably means that its life span is coming
to an end. Or is it?
We recently upgraded our software
to the new Visual BASIC for DOS in
the hope that it would contain enough
hardware control commands to make
it worthwhile. All over the packaging,
they make the claim that it will run
all QBasic and QuickBASIC 4.5 pro
grams. In fact, if you look through the
November 1994 77
The programming environment displays the code editor as soon as you boot up.
It has quite a few similarities to the old QuickBASIC 4.5. The menu box on the
right is used to change between the code & form editors.
monochrome monitors with no
graphics facility, we can only hazard
a guess that this may be the reason
why text-only screen windows are
available. For a language created in
1992, this does seem a bit archaic,
particularly when you consider that
the soon-to-be released Windows 4
won’t even run on a 286 machine, let
alone on an XT!
Memory requirements are at least
640Kb of RAM but it will support
XMS (extended) and EMS (expanded)
memory if your PC has it – sort of.
So long as you’re prepared to run
your application from the programming environment – that is, from
within Visual BASIC – you’ll be able
to use the upper memory. However,
if you prefer to run compiled applications from the DOS prompt, then
you’re stuck with the 640Kb limit. In
this respect, it hardly seems much of
an improvement on QB4.5.
Of course, by running DOS 5 or later,
you can push most of DOS into the
upper memory area and have around
600Kb left for your application. That
said, we would have thought that it
wouldn’t have been too hard to incorporate E/XMS driver support in
the compiler.
The pluses?
The code here is for CALC.FRM, a basic function calculator. This comes with VB
for DOS & gives you an idea on how to program using this system. By clicking
on the up arrow, you can make the code editor full screen size.
manuals, the QB4.5 command set is
actually a subset of VB for DOS. This
thankfully means that all QB4.5 programs can remain alive for some time
yet. And more importantly for those
of us who like to “tinker” and play
around with our PCs, it means that all
of the QuickBASIC hardware control
commands have been retained in their
past format.
However, if that’s the case, what are
the new features in this Visual BASIC
for DOS? Well, its main selling point
is its ability to create a DOS version of
the Windows user interface with command buttons, dialog boxes, directory
listings and the like.
While these can make it much
easier for a user to run programs, the
78 Silicon Chip
interface is designed to run from the
text screen only – so you can’t produce any fancy graphics or company
logos. This is disappointing but more
on this later.
Hardware requirements
One of the reasons for this is probably due to the fact that VB for DOS
will run on any 8088-based PC. Note
that it won’t run on an 8086 machine.
If you want VB to run on your old XT,
you’ll have to open the lid and have
a peek inside to see which processor
you have. What you need to look for
is a 40-pin dual in-line (DIL) IC. It will
either be marked 8086 or 8088. If it’s
an 8086, then you’re out of luck.
As many, if not most, XTs used
Well, one thing that no one can take
away from Visual Basic for DOS is
its mouse control command support.
Now you can add mouse support to
all your programs by simply adding
in the appropriate commands. You
don’t need to know anything about the
mouse hardware or interrupts. This is
one feature that everyone will agree
was badly needed on QB4.5.
The manuals, although a bit confusing at times (aren’t they all!), have
been split into two 650-page plus
volumes – one a programmer’s guide
and the other a command reference
manual. The programmer’s guide contains all the peripheral information
such as converting programs from
QB4.5 to VB and describes how to
produce a Windows-like interface. It
also includes a compatibility chart
between VB for DOS and Windows,
QuickBASIC, QBasic and even the old
GW-BASIC.
The reference manual contains detailed information on each command,
as well as programming examples for
most of the commands. Most of this is
also found in the on-line help system
The complier is said to be more efficient in creating code which means
that your programs will run faster. One
good thing they suggest is that you
can load your QuickBASIC programs
into Visual BASIC, compile them and
they’ll run just the same as before,
only faster.
Product support
The form editor is where your graphic screens are designed. You are limited
to block graphics which is disappointing but it allows all PCs to use your
programs. The menu box on the left allows you add a variety of tools, including
command buttons, directory boxes and ASCII graphics.
This window shows you the possible subroutines which can be modified in the
code editor. The numbers to the right of each subroutine are the sizes to the
nearest kilobyte, while the “cmd” before each subroutine indicates that it is
based on a command button response.
which will tell you almost all that you
need to know.
How is it to use?
If you’re used to QuickBASIC 4.5
and its programming envi
ronment,
then it won’t take you too much
time to get used to the new format
of VB. As we mentioned in the VB
for Windows review, programming
is now based on what is called “object oriented programming” or OOP.
Instead of writing your programs in
the conventional manner, you have to
take into consideration what the user
could be doing.
If you have a series of command
buttons appearing on the screen for
example, you must consider that
any one of those buttons could be
activated and you have to write code
to handle that.
When programming, you’ll find
yourself swapping between the user
interface editor and the programming
editor. The user interface editor allows
you to create screens called “forms”
which the user will see. These are
created using a process that’s similar
to using a desktop publishing program.
You click and drag out marques to
indicate the size of the item you wish
to put on the screen, whether it is a
command button or a dialog box. In
this respect, it is very similar to the
Windows version.
We had a few questions to ask Microsoft on how some aspects of the
language worked. So we decided to
ring up the product support division of
Microsoft, just as an ordinary customer
would, to get some help.
After ploughing through their infuriating phone system, we were told
we’d be charged $35 for each call
made. When pressed, we were told
that “product support is not included
in the purchase price of most Microsoft
products”. Come on Microsoft, can’t
we have just one call?
The other alternative is to look at
some of the computer books from
companies such as Que Corporation
and others. They have produced quite
a few good books on both the DOS and
Windows version of VB.
If you desperately need to use EMS
or XMS memory in your compiled
programs, you will require the professional version of Visual BASIC. With
this version, you also get the ability to
produce compiled code which is optimised for either 286 or 386 processors
but at $765 RRP, or more than twice
the cost of the standard version, the
price seems a little steep.
Conclusion
If you have an investment in Quick
BASIC and you’re looking for the upto-date product, then Visual BASIC
for DOS is it. But if you don’t need to
create a Windows-like interface, then
you may be better off sticking with
what you’ve got.
We also feel that it could have been
made to do a whole lot more. Had
they included the option of having
the windows operate in VGA mode,
it would have been almost ideal and
a huge leap above QuickBASIC 4.5.
Instead, it’s more of an upgrade for
QuickBASIC rather than a “whole new
programming system”.
At the time of writing, the recommended retail price of Visual Basic
for DOS is $295 but don’t expect to get
any support for that price – support
SC
costs extra.
November 1994 79
|