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