Back to course page.
The programs are in the J:\CofC\cofcii-vb folder. There is a folder for each program: Counter etc.
So, to run the Counter example, you would navigate as follows:
My Computer > Programs on 'calawah' (J:) > CofC > Counter
You should see the files Counter.vbp, Counter.vbw, and frmCounter.frm.
To load the program, double-click on Counter.vbp or frmCounter.frm. Then you can run it (or do anything else) using VB in the usual way.
To make a copy of the program, use the VB Save frmCounter.frm As... then Save Project As...to save the form file and the project in your own folder. Or, you can just use Windows to copy the files.
A VB project consists of (at least) a .vbp file, a .vbw file, and a .frm file. They are ordinary text files. You can use your browser's Save As... function to download the files (links below). Put them in the folder where you want to run VB. You will have to rename the files: rename Counter-vbp.txt to Counter.vpb, etc. (they all have to be named .txt here so the browser will display them properly). After you rename the files, VB should be able to find, load and run them. Of course, in order to run the programs on some computer you must have VB installed there.
The code you see in the VB code window appears at the end of the .frm file. At the beginning of the .frm file are the descriptions of all the controls on the form. This has to be there but does not normally appear in the VB code window.
Links to the source files for the example programs appear below.
Traffic light simulation
Animated traffic light simulation
Square root finder
Search an array
Read, process, write, a text file
Orbital physics simulation
Back to top