Calculator


FoxPro includes a calculator which might be useful to some of your users. It is not as sophisticated as the Calculator in Windows Accessories. It is just a simple four-function calculator with memory but it will be adequate for many users and is very easy to control.

You can call the calculator from a command button or from a menu option and the calculator's displayed value and memory value are both available to your program.
[Calculator]

Controlling the Calculator

Displaying the calculator is a simple matter of making its window visible:

Activate Window 'calculator'

You can hide the calculator by using Hide Window or Release Window or you can allow the user to close it.

The calculator values are stored as FoxPro system variables:

_CALCVALUE      && Value
_CALCMEM        && Memory

Both these memory variables are Read/Write so you can make the calculator appear with default values in its display and in its memory and then read these back to see whether the user has overridden them.

Like the Calendar, the Calculator tool has been available in FoxPro since version 2.00.


Hints & tips

The textbox class in Visual FoxPro 9 has a new Autocomplete property which shows the user the previous values that have been entered in that textbox.
Autocomplete in VFP 9

Your Access database will look more impressive if you add custom toolbars...
Custom toolbars

FoxPro has always had functions to read and write files at a low level...
Foxpro low level file functions

More...
More pages of hints and tips for users of Microsoft FoxPro and Access databases.

Site Map