If you are unfamiliar with the BASIC computer language, then please read this first. But if you are an expert in BASIC, then just skip down to the programs.
Below are some old freeware science programs for PCs, written in BASIC, that I wrote many years ago (around 1989). They range from ridiculously simple to almost sophisticated. I recently rediscovered the programs when I was cleaning my house. Rather than throw them away, I thought I'd put them on the web. The great circle distance calculator program and the geology point-count program are particularly useful. Best of all, they are guaranteed to be virus free and they won't cost you a cent! I hope you enjoy using them.
PLEASE NOTE: You will not be "downloading" these programs. Instead, you will be copying them to your clipboard. You must do the following:
1) You must have a PC with an operating system that can open a DOS window (or that can boot to DOS).
2) Make sure you have a copy of GWBASIC.exe, BASICA.exe, or QBASIC.exe installed on your computer. You need one of these to run BASIC programs. If you don't have one of them, you should be able to find a copy on the Web. If you are using Qbasic and are having trouble getting the programs to load and run, read how to easily fix the problem.
3) SELECT (highlight) all of the program code on the page, and COPY it to your computer's clipboard.
4) Open NOTEBOOK and create a new (empty) text file (.txt). Example: eventti.txt
Warning: Do not use a word processor that word-wraps lines!
5) PASTE the BASIC code into the text file and then SAVE the file into the same folder or directory where your BASIC interpreter program (GWBASIC.exe or BASICA.exe) resides.
6) Carefully look over the program code and make sure that each numbered line is on one line. If a numbered line occupies two lines, then edit it so that all of the code is on one line.
7) RENAME the file with a .bas extension. The file name can be up to 8 characters long (that's because of DOS's archaic limitations!). The .bas extension is the important part. Example: eventti.bas
8) To RUN the program, you must first open a DOS window and then run the BASIC interpreter. In the case of GWBASIC, open a DOS window and then type: gwbasic.exe and press (ENTER).
(Or you can create a Windows shortcut to GWBASIC. Then all you have to do is click on the GWBASIC icon).
9) After the GWBASIC interpreter program has started, type FILES and press (ENTER). BASIC will then show you a list of your programs.
10) To RUN a program, type:
load "filename.bas"
and then press (enter). (include the " " marks around the program's name).
11) Then type: run
12) To exit BASIC and return to Windows, type: system
and press (enter). Some of my programs automatically do this.
13) To exit a BASIC program while it is running, press (Ctrl) and (Pause) keys simultaneously. Then type: system
and press (enter).
14) TROUBLESHOOTING:
If you are using Qbasic and are having trouble getting the programs to load and run, read how to easily fix the problem.
If the program still does not run, it is probably because one or more program lines have word-wrapped when you pasted the code into the text editor (see steps #3, #4 and #5). Note: When the program is loaded into GWBASIC.exe, any long lines will automatically word-wrap. This is normal and okay. The problem is actually back in steps #3-#5. You must go back and repeat the process and check the original .txt file. Now do you understand why you must use NOTEBOOK, instead of an advanced word processor? ;-)
If you try to load the program and BASIC says that the program cannot be found, make sure that your file resides in the same folder or directory as your BASIC interpreter program (BASICA.exe, GWBASIC.exe or QBASIC.exe). Also be sure that your program has a .bas extension. If it doesn't, then rename it with the .bas extension.
In some cases, GWBASIC will show you the offending line of code when you attempt to RUN the program. If so, simply make corrections to that line and press (enter). The cursor must be placed on the line of code when you press (enter). Then RUN the program again and see if that solves the problem. If everything works, be sure to SAVE the program to preserve the changes. To SAVE a program when running GWBASIC, type:
save "filename.bas"
and then press (enter)
GWBASIC/BASICA and Qbasic allow a maximum of only 8 characters in the file's name.
Both QuickBasicTM (which is not the same as QBasic) and the old Visual BasicTM for MSDOS can compile these programs into a DOS executable (*.exe) code that doesn't need the BASIC interpreter to run! Unfortunately, all versions of Visual BasicTM for Windows can not compile these programs into an executable. (sorry).
HERE ARE THE BASIC PROGRAMS
gr-circl.txt
This program computes great circle distances between any two points on the earth if their latitudes and longitudes are known. It also calculates the antipode for any location on Earth, and it can compute the rotational velocity for any latitude. Very useful!
appa-dip.txt
A geology program that computes the "true dip" angle of a rock bed if you know: 1) the "apparent dip" angle of the bed (as seen in a highway road cut or outcrop); 2) the strike of the dipping bed; and 3) the strike of the road cut on which the "apparent dip" angle is observed.
eventti.txt
This program will record the date and time of any event or events whenever a key is pressed. Saves the events and their times to a text file. It is useful for recording and tabulating events. It also makes an "okay" stopwatch (accurate to one second).
g-calc.txt
Do you have a laboratory centrifuge and want to know the 'g' for a given RPM? Or do you want to play around with artificial 'gravity' experiments? This nifty little calculator will calculate acceleration (and 'g') for any given radius of rotation and rotation rate.
timer.txt
This is a simple timer/alarm clock program. You can set the alarm for weeks or months in advance (although the computer must be running continuously). Accurate to one second. Now including DB-9 serial port output!.
point-co.txt
This geology program uses the computer's keyboard as a tabulating device for point counting sedimentary rocks in thin section. It also gives ternary summaries and other statistics, and it saves the results to a text file. With a little tweaking, it could be adapted for point counting volcanic rocks in thin section. Very useful!
prime-no.txt
A neat little program that uses a simple "brute force" algorithm to determine if an input number is a prime number. Really simple code. Can you improve it?
x-ray.txt
This X-ray diffraction (geology) program will convert d-spacing (in angstroms) into 2-theta (in degrees) and from 2-theta into d-spacing.
antipode.txt
This program will calculate the antipode for any point on the Earth. (The antipode is on the opposite side of the Earth from the input point. A straight line drawn through the center of the earth would connect the two points).
bivariat.txt
This program computes simple statistics (mean, standard deviation, correlation coefficient, and it computes a linear regression equation) for a bunch of X and Y data. The program saves the data and results to a text file.
h2o-pres.txt
This program computes ocean (salt water) pressure, in pounds per square inch, at any chosen depth.
density.txt
This geology program uses the results of a point count (see "point-co.txt", above) to calculate the density of a rock sample. [not available at this time].