Borland C++ 4.0 Programs for MSDOS
Some use no MSDOS-specific functions and may be usable under, or easily
modified for, any platform.
Each project link goes to a separate page with a more complete program description, a
code listing, sometimes screenshots, and, if the project is large, a link to download its zip file.
I was surprised to discover how easy it is to convert old Borland code to
Microsoft Visual C++. Text substitutions in the code are often all that's
required to convert Borland's BIDS TArray classes to STL. I've done a few
project conversions already. Comparing the programs here that exist in both
versions might provide you with tips for converting your own code.
You can download the Borland® C++ 5.5 Compiler and other command line tools from the Borland spin-off company,
CodeGear. The
downloads are free of charge, and the programs do not expire. They also have trial versions of their current products.
C++ utility functions and miscellaneous
| my.h |
Most of my programs #include "my.h". I've
used this set of typedefs, #defines, function prototypes, and template functions
with MSDOS, Borland
ObjectWindows (OWL) for Windows, and Borland's EasyWin Windows
console interface. |
| mylib.cpp |
Most of my programs also #include mylib.cpp, an assortment of library routines. I've used this file
with MSDOS, Borland OWL, and Borland EasyWin. Pulling the libraries directly into the source file makes it unnecessary to keep multiple object
code libraries and remember which ones go with which memory models,
platforms, or compiler switches. Mylib.cpp is written so that it automatically excludes any of its sections that are
incompatible with the main program's target platform.
Mylib.cpp used to have many #includes of external files that were listed here on separate web pages. The current mylib.cpp
page (above) now has all its
code listed on one page. However, the following three old pages of function code listings do still exist: |
| |
|
C++ utility classes
|
Anyclass.cpp |
A template (code snippet) containing formatted skeleton text needed
for creating most classes. Paste into your program, do one search-and-replace,
then fill in the blanks. |
|
Array for calculating statistics |
A class that accumulates a list of numbers or ordered pairs and can report
statistics about them at any time, including linear regression and correlation, line of best fit, chi squared, Student's t
test, and more. Besides making it possible to incorporate statistics and significance testing into a C++ program, it has potential usefulness for artificial intelligence:
overloaded operators allow it to be used as a variable that
keeps a history of its own prior values so it can potentially make inferences, predictions, and judgments based on them. |
|
Array for tabulating frequency counts |
A template class that maintains an array of unique items, along with the
frequency count of each (how many times you have the added an identical item
to the array). |
|
Giant Array (large vector array) |
A template class that allows arrays of unlimited size by creating a
linked list of multiple TArrayAsVector and treating them as though they
were one big array. |
| Stopwatch timer class |
A crude stopwatch class that can be used for timing things. |
|
File Array (list of file names) |
A class that holds a list of disk files as an array of strings. It can
build the list from wildcards, and provides functions for retrieving names
from the list. |
|
Rectangle using doubles |
Like OWL's TRect, but with doubles used for dimensions and calculations. |
|
Music.cpp |
A music-related class (Scale) that creates musical scales in 12 keys and
in a variety of musical modes, and also a program that uses the class to generate
random music
played through the PC speaker. |
|
Drop-in support for RS232 serial communications, XModem |
A drop-in class for MSDOS that provides RS-232 serial communication
capabilities, including xmodem support in single-file or batch mode. The
page also has a modem program that uses the SerialCom class. |
| Word List, Text Substitution |
WordList is a utility class that maintains a sorted list of unique words
or phrases. TextSub and TextSubArray allow translating one word or phrase to
another. Both use the Borland BIDS template container classes. |
Utility programs
|
Text file print utility |
Utility for printing program source code or other text files, with
options for setting tab expansion, lines-per-inch, lines-per-page, margins, line numbering,
and more. |
| Keycodes |
Reports the key code generated when you press a key. MSDOS-specific, uses
Borland DOS-only functions. |
|
Read absolute disk sectors |
READSECT.CPP reads absolute disk sectors using Borland C++ 4.0 MSDOS
DOS-only functions. It can only read formats that are supported (recognized)
by DOS. |
| Strip parity bits in a file |
Mapdown.cpp is yet another of my programs to strip (zero) the parity bit of all bytes in a file, which apparently I needed to do a
lot over the years. I think this version needs some fixing. |
|
Classify ASCII characters by isalpha, isalnum, etc. |
Classifies 256 ASCII chars by the various Borland C++ 4.0 functions such
as isascii, isalpha, etc. |
|
Mandelbrot set
|
Bifurcation diagram
|
IFS Fractal
|
Game of Life 1d
|
| Click thumbnails for full size images |
Other MSDOS programs in Borland C++
The graphics ones use Borland BGI graphics. Of the ones I've tested so
far, these DOS versions of the programs, originally compiled for MSDOS or a
DOS window under Windows 3.1, run successfully in Windows XP.
| Neural network |
A rudimentary neural network program. It uses the Borland BIDS container classes. |
| Mandelbrot display |
Calculates and displays regions of the Mandelbrot set. |
| Logistic map bifurcation diagram |
Displays the bifurcation diagram or logistic map of the equation
X=RX(1-X) as discovered by Robert May and described in Chaos, by
James Gleick, about Chaos and fractals. |
| Randomly generate IFS fractals |
Continuously draws fractal shapes in color based on randomly-generated
IFS (Iterated Function System) sets. A partner program (Showfs.cpp)
reads a data file and draws the fractal image that it defines. A third
program converts IFS files to PFS (rectangular to polar converter). |
| Game of Life |
Plays the Game of Life, a cellular automaton originated by John Conway. |
| Artificial Life, Evolution
in a virtual cell colony |
Creates imaginary animals (as dots) that move around the screen
according to self-contained programs, eating each other and creating
offspring using a genetic algorithm, such that the programs evolve by a
genetic method, according to which are most effective at either obtaining
food or producing offspring. The methods of this program were adapted to create two others:
|
| |
| Diffusion Limited
Aggregation simulator |
Particles randomly wander around the screen (Brownean motion), sticking together
when they collide. The aggregating blobs also continue to wander, collide,
and stick together. |
|
Trajectory display |
Shows the parabolic path and changing velocity of an
object "fired" onto the screen at various angles. |
|
|
Classifier System |
A classifier system program written after reading a description of
John
Holland's original classifier system concept. Pertains to learning,
adaptation, and evolution. |
| Create and solve substitution ciphers |
The Encipher.cpp program creates a substitution cipher from a text file. Decipher.cpp
assists you with solving a substitution cipher by providing an interface
where you can easily and quickly swap letter translations and see the
results immediately in the text. |
|
Display graphic normal distribution |
Builds and displays a normal distribution graph by dropping
"marbles". |
|
Amateur Radio Net Control |
Efficient interface for taking roll call, checking members into a
radio net. The project also contains a Microsoft Access database with a form that
attempts to provide the same functionality, and an Excel workbook that
calculates some statistics. |
|
.PIC file graphics experiments |
Crude graphics experiments that display, animate, edit, transform, and
attempt animated rotation of .PIC files. |
|