Project
1, Part I
Astrological
Toys
In this project a series of window
applications will be written that look up and display astrological signs and
dates. The applications that will make up the project are as follows:
The projects are written in Visual Basic 6.0
and serve as the initial foray into algorithmic thinking, program design and
the characteristics of VB6.
It is suggested you create a new folder for
each project. This will assist you in keeping track of all of the various files
produced as well as simplifying saving your work to the floppy disk.
This Time. This is a simple digital
clock program with the date on the window bar. The goal in writing the digital
clock program is to create an initial VB6 program. The essential features are
Each of these features will be discussed
below. The ThisTime application has the following window interface:
Open Visual Basic 6.0 (accessed as an element
of Visual Studio 6.0), and click on the Standard.exe
application that is highlighted. This will
open a project, probably called Project 1,
with a new form, called Form1.
Private
Sub Form_Load()
frmClock.Caption = Date
End
Sub
Date is a built-in global variant object that returns the
date as set on the computer in the form mm/dd/yy. When the form is loaded, the
current date will appear on the window bar.
Private
Sub tmrTime_Timer()
lblTime.Caption = Time
End
Sub
Time is like Date, a
built-in global variant that returns time in hh:mm:ss xM format. What happens is
this: The timer "goes off" every second. That event causes the
procedure "tmrTime" to be called. It changes the caption of the
label to the current time. Whenever anything on the form is changed, the window
is "repainted," i.e. redisplayed. Since most of the information is
unchanged and remains in a fixed position, the clock appears to be ticking.
To turn in your project, please go to the turnin page for Project 1 Part 1. You will need to turn in two files: the
Visual Basic Project File, and the Visual Basic Form File. Please make sure your project is working and
the files are consistent before turning them in. (If you do notice a problem, you can run turnin again. We’ll only grade the latest version you turn
in, up to the deadline.) Here is the help page for turnin.
(This help page is also linked from the turnin page.)
Optional: when it’s completed, you can compile
your program by going to Make
ThisTime.exe in the File menu. That operation will make another file in the
directory you. This is the ThisTime.exe file. To run
your program, double click on the ThisTime.exe. (Only do this if you feel like experimenting
with making a .exe executable file. The
version of Visual Basic on the CD-ROM in the back of the Visual Basic text has
this capability disabled, so you’ll only be able to do it using the version of
VB in the collabs.)
To save your work you will have to move these
files to your floppy disk or to your Dante directory. And to work on them
again, you’ll have to bring them back from Dante to a PC.