Dec 182017
Dbase III code for a simple floating point "calculator" that performs some basic hand-held calculator functions.
File D-CALC.ZIP from The Programmer’s Corner in
Category Dbase Source Code
Dbase III code for a simple floating point “calculator” that performs some basic hand-held calculator functions.
File Name File Size Zip Size Zip Type
CALC.C 12629 2310 deflated
CALC.DOC 2475 1124 deflated
CALC.EXE 27342 17160 deflated
CALC.FMT 2123 452 deflated
CALC.PRG 12542 2404 deflated

Download File D-CALC.ZIP Here

Contents of the CALC.DOC file

Dan Kenny
Omaha, Ne.

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
produce CALC.EXE.

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....

 December 18, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>