FoxPro Calculator

Visual FoxPro includes a simple four-function calculator which might help some of your users. This calculator is not as sophisticated as the tool in Windows Accessories, it is just a simple four-function calculator with memory. Despite that, it will be adequate for many users and is very easy to control. [Calculator accessory in Visual FoxPro]

The calculator does not appear as an option on the FoxPro menu system. The only way to make it appear is through program code. You can write code to call the calculator from a command button or from a menu option and the calculator's displayed value and memory value are both available for use.

Controlling the Calculator

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

Activate Window 'calculator'

You can hide the calculator programatically with the commands Hide Window or Release Window. Alternatively you can allow the user to close it in the normal way.

The calculator values are stored as FoxPro system variables:

_CALCVALUE      && Value displayed
_CALCMEM        && Value in memory

Both these system memory variables are Read/Write so you can put default values into the calculator display or memory before it appears and you can read them back to use in further calculations.

Because the Calculator is a window within FoxPro, you can use the standard functions to inspect its status. For example:

?WVISIBLE ('calculator')

will return .T. if the Calculator window is visible.

Like the Calendar, the Calculator tool has been available since version 2.00 of FoxPro for DOS. Both tools look rather dated now but both can still be very useful.

Access Tips

FoxPro Tips

General Tips

 

Related Items

Alvechurch Data - Microsoft FoxPro and Access Database Development and Training

Alvechurch Data provide training and development support for businesses using Microsoft FoxPro, Visual FoxPro and Access databases.

Read More

Autocomplete in Visual Fox Pro

Autocomplete in Visual Fox Pro

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.

Read More

FoxPro Functions

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

Read More

Development Services

Alvechurch Data have fifteen years experience developing databases for small business use.

Read More

Training Services

Details of the training courses offered by Alvechurch Data.

Read More