Visual BASIC 3.0:
the new standard?
Visual BASIC has taken the world by storm &
is fast becoming the programming standard for
creating Microsoft Windows packages. We have
taken a look at the latest version & can state that
it really works well.
By DARREN YATES
Question: what computer language
was introduced more than 20 years
ago and has evolved to still be at the
forefront now? Answer: BASIC.
Just as the Spitfire of World War
II saw many changes and variations
throughout its life, the basic design
could not be mistaken as it flew
through the skies of Europe. In the
same way, BASIC has seen many variations, additions and improvements
over the years to the point where it is
now seen as the easiest, most economical and one of the most powerful ways
to program for Windows.
While there are two versions of
Visual BASIC currently available –
one for DOS and one for Windows,
it’s the one for Windows which really
deserves the most attention.
To run Visual BASIC for Windows
version 3.0 requires at least Windows
3.0 but it runs optimally runs under
Windows 3.1. Memory requirements
are said to be at least 2Mb but it will
run faster with 4Mb. You’ll also need
a hard disc with about 12Mb of space,
an EGA or better monitor, and a mouse.
When you get hold of the package,
the first thing you notice is its weight!
This is not from piles of 3.5-inch floppies but mostly due to the two large
manuals that come with it. These have
just on 700 pages each, so you can expect to have done quite a lot of reading
by the time you’re up and running the
system properly.
The programmer’s guide takes care
of language concepts and using the development system while the language
reference details each instruction and
how it is used.
The overwhelming thing you’ll find
when flicking through the manuals for
June 1994 69
the first time is the myriad of commands that look nothing like those of
the old QuickBASIC. In fact, the big
disappointment about Visual BASIC
is that many of the old QuickBASIC
instructions are not supported. The
impression is that because you now
have access to the Windows programming environment, you no longer need
these “antiquated” instructions.
Programming environment
As with many programs these days,
installation is basically a non-event.
You load the Windows Program
Manager, run the SETUP program on
the first disc and it literally does the
rest. All you need to do is fill out your
registration card while you watch the
graphics appear on the screen.
The programming environment
will probably throw most people at
first glance because it looks nothing
like what most programmers would
be used to. It’s fair to say that, by
moving from DOS to Windows, the
whole approach to programming has
been changed.
Back in the days of GWBASIC, just
about every program was designed as
a top-down program; ie, the program
decided where the user would go and
that usually meant starting at the top
and working your way through to the
bottom of the program where the END
statement was found.
Nowadays, programs are written
using a method known as object-oriented programming where instead of
the program deciding the user’s course,
the user decides where the program
goes next. Windows is the perfect example of this and when programming
for Windows, you are really forced to
follow the same format if you wish to
take advantage of its graphical user
interface (GUI).
So instead of just writing code that
goes from start to finish, you have to
write code in sections or subroutines
that take into account whatever the
user may wish to do with your particular application.
And because Windows is such
a graphical interface, you have to
program the windows or “forms” the
user sees. However, this is actually
quite easy thanks to the development
environment. In fact, it’s very much
like setting out a page in just about any
desktop publishing system.
To program in the forms, you simply click on icons in the tool box to
70 Silicon Chip
This is an example layout of a form. It was created using the directory & disc
tools available from Visual BASIC’s toolbox. These two tools allow you to
display the directories of a given disc drive without the need to generate code.
The program is activated by the two command buttons (Quit & OK).
The Properties box
(left) contains all the
parameters of a given
form, including size,
colour, font & font size.
The main Toolbox
(above) contains all
the common Windows
functions; eg, dialog
boxes, command buttons
& scroll bars.
This is the first screen
of the SetupWizard
installation utility.
This utility generates
the setup program for
easy installation of
your program into the
Windows environment.
drag down labels and
command buttons, as
well as pictures and
icons.
You have access to
around 200 icons plus
there are many hundreds more available on shareware which leads me to
another point. Inside the package is a
little catalog from BASICPro magazine
which details many third-party add-on
packages to add to your Visual BASIC, many of which are supported by
software companies here in Australia.
This is a great idea because as good
as Visual BASIC is, there is a definite
lack in access support for the hardware
ports; ie, no IN or OUT statements.
However, there are a few third party
companies that have packages to support these commands.
Setup Wizard
One of the features in version 3
which will attract a lot of interest is
the new Setup Wizard utility. This
program allows you to create the
professional-looking setup programs
for your finished product just like the
one Windows uses.
It automatically takes care of all the
files you need and generates the master
distribution discs. These can then be
copied onto discs for users and they
can then install the program using
this setup utility. You have to provide
the directory name that the program
should be stored in but the user can
change this when installation is taking
place. There is no need for the end user
to have to figure out how to install the
program or where to put it.
Language development
If you can remember back to the
days of the Commodore 64, many of
which are still being used today, the
BASIC language it used was quite
primitive, providing only a few
high-level func
t ions. Quick BASIC
improved things greatly by being
able to include subroutines, as well
as having easy access to the BIOS and
DOS routines.
Now that Visual BASIC has arrived,
it would seem that the complexity of
the language has increased markedly
and this can be either a bad or a good
thing. Although there are an incredible number of instructions which
allow you to do just about everything
except brush your teeth, you have to
have a memory capable of storing
half a telephone book to get really
on top of it.
It’s not until you look at the manuals that you realise just how much
is involved in writing programs for
Windows and I think that was the main
influence on making the development
environment as functional and as
powerful as possible. Flexibility with
this language is the key to it being able
to produce just about any application
you can think of.
OLE capability
One of the other new features which
will make Visual BASIC 3 a success
is its object-linking and embedding
(OLE) control. This allows Visual
BASIC to display and manipulate data
from other Windows-based programs
such as Microsoft Excel.
This makes it easy to incorporate
professional graphics into your programs without having to sit down
and draw them line by line. The
overwhelming impression is that this
has been designed for business applications however it should be possible
to incorporate circuit diagrams from
say AutoCAD for Windows which will
make it useful in the electronics field.
All in all, Visual BASIC is a winner
if you need to produce professional
programs for Windows and take advantage of its position in the market
place. Essentially, it bring Windows
programming to a language that has
long been considered as a hacker’s
code. Obviously, Microsoft doesn’t
agree.
However, with Windows 4 due for
release later this year, the word is out
that the old DOS has only a few more
years left in it. So in order to remain
at the top of the programming heap,
Visual BASIC and products like it will
have to take over from the industry
standard QuickBASIC 4.5 and the
like. If this is the case, later versions
of Visual BASIC must include easier
access to hardware ports and provide
more information on programming
them. It still has a way to go to match
QuickBASIC on that score!
Visual BASIC 3.0 is available in two
versions. The standard version costs
$249 and contains everything you
need to write the average program plus
the SetupWizard utility. The Profes
sional version retails for about $650
and contains some extra utilities, as
well as information on all the routines
available in the Window’s application
programming interface (API). You can
contact your nearest Microsoft dealer
SC
for more details.
June 1994 71