Contents of the CALC.DOC file
Following are some program files representing a simple floating point
"calculator" for performing some basic hand-held calculator functions.
CALC.DOC - This file
CALC.PRG - Dbase III .PRG code for the calculator
CALC.FMT - Dbase III .FMT code for the calculator
CALC.C - Translation of the .PRG code to Turbo C code
CALC.EXE - EXE file of CALC.C compiled using Small Mem Model
The main program(s) are CALC.PRG/FMT. I wanted a generic standalone calculator
utility (TSR's are a pain sometimes), so I decided to code one up in the Dbase
programming language. Application developers using a Dbase compiler (or Foxbase)
might find this code useful to enhance their end-user applications by adding a
"calculator" feature. If your DBMS deals with numbers, this feature comes in
mighty handy sometimes.
I also wanted to include an executable version of the code, but Quicksilver and
Clipper pad too much overhead on EXE file size. So, I translated the Dbase code
to Turbo C code (it was also a good exercise for myself), and compiled it to
Ths Dbase code should run/compile clean on FoxBase, Clipper, Quicksilver,
Force III (hahaha...oops, sorry-bad joke), and dBASE IV (assuming backward
compatability). It runs too slow on an interpreter like dBASE III or dbXL,
so I wouldn't even mess with it in those environments.
The C code was intended to be as close of a line-by-line translation of the
Dbase code as possible, so there are many inefficiencies in the C program
(and I'm sure in the Dbase code, but, hey, it works....). The C code is
portable to other C compilers if you can provide gotoxy and cls functions.
Direct video addressing is flagged ON, so there may be snow on your display
when you execute this program. If so, recompile using BIOS (directvideo=0).
Some program documentation for the calculator is in CALC.PRG. I didn't comment
the C translation code, as it is meant more to be a translation of the Dbase
program than a well-documented, optimized C program.
This program and the code have been placed in the Public Domain by the program
author. You may feel free to use this program code in its original, mutilated,
and/or enhanced form....