25 Years of Programming
An open source source for C, C++, OWL, BASIC, MDB, XLS, DOT, and more...
Home   Projects   Up   Sitemap   Search   Blog   Forum+Chat   About Us   Privacy   Terms of Use   Feedback   FAQ   Images   Services   Ads   Donate   Humor

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 link goes to a separate page with a more complete program description, a code listing, 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 at http://www.borland.com/downloads/download_cbuilder.html. The downloads are free of charge, and the programs do not expire. They are prior versions of current and previous Borland products.


Utility functions and misc.

my.h
When my programs #include "my.h", this is what is being included. I've used it with MSDOS, Borland OWL for Windows, and Borland's EasyWin Windows interface. It has an assortment of typedefs, #defines, function prototypes, and template functions. As of 5/31/2007, all #includes of external files have been replaced with the code from the previously included files.
 
mylib.cpp
Most of my programs #include mylib.cpp, which automatically pulls various library routines into the program, excluding routines that are incompatible with the main program's target platform. I've used this file with MSDOS, Borland OWL for Windows, and the Borland EasyWin Windows interface. Doing it this way makes it unnecessary to keep multiple object code libraries and remember which ones go with which memory models, platforms, or compiler switches.

As of 5/31/2007, all #includes of external files have been replaced with the code from the previously included files. It is no longer necessary to round up code from the following 3 pages. However, these 3 pages do still exist:
 
Functions for MSDOS (and EasyWin or OWL)
These functions should be compatible with MSDOS, ObjectWindows Library for Windows, EasyWin, and maybe any other target type.
 
Functions for MSDOS (and EasyWin)
These functions should be compatible with MSDOS or EasyWin.
 
Functions for MSDOS only
These all use Borland DOS-only functions; most also use the Borland Graphics Interface (BGI).
 

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  (SStatArray)
A class that accumulates a list of numbers or ordered pairs and can report statistics about them at any time, including regression, line of best fit, and for some purposes, chi squared. Its potential usefulness for artificial intelligence is that overloaded operators allow it to be used as a variable, a variable that has a history of its own prior values, and can potentially make inferences, predictions, and judgments based on them. Unfortunately, I do not yet have an application that has used it in this manner.
 
Array for tabulating frequency counts  (FreqArray)
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  (a timer class)
A crude stopwatch class that can be used for timing things.
 
File Array  (holds 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 (DoubleRect)
Like OWL's TRect (except for some significantly different behavior), but with doubles used for dimensions and all 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 RS-232 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.
 
WordList, TextSub, TextSubArray (list of words, 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)
Yet another program to strip (zero) the parity bit of all bytes in a file. 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
Mandelbrot set area generated by the Borland OWL Windows version of this program. Click for full size.

Bifurcation diagram
Logistic map bifurcation diagram area generated by the Borland OWL Windows version of this program. Click for full size.

IFS Fractal
IFS fractal image generated by the Borland OWL Windows version of this program. Click for full size.

Game of Life 1d
An unusual Game of Life screenshot, in 1-dimensional mode. Click for full size.

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 these programs, originally compiled for MSDOS or a DOS window under Windows 3.1, do run successfully under 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:
 
1) 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.
 
2) 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 (Encipher.cpp, Decipher.cpp)
One program creates a substitution cipher from a text file. The other 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.
 

 

 

Valid HTML 4.01 Transitional Valid CSS
View content labeling at ICRA.
Copyright ©2008 Steven Whitney. Last modified 07/03/2008.