51CALC

for WordPerfect 5.1

Copyright 1990 by Karl M. Rowe

ALL RIGHTS RESERVED

This macro, made especially for use with WP 5.1. will permit standard mathematical calculations from within WP 5.1 without having (necessarily) to resort to a calculator or even a TSR "pop-up" type calculator. By "standard" I refer to calculations requiring the use of the operators add (+), subtract (-), multiply (*) and divide (/).

WPCorp ships with copies of WP 5.1 a macro keyboard file called "MACROS.WPK" which contains the macro "Calculator" on the Ctrl-C key. However, 51CALC is a bit superior in that:

You may use commas, decimal points, even dollar signs (although, unlike commas and decimal points, are "thrown away");

You may retrieve and print the "tape" it creates and saves to WP 5.1's "block buffer."

51CALC is also a bit superior in the respect that it handles negative numbers quite handily, enclosing them within parentheses.

It can be invoked at any point in a document, for it includes a routine which "cleans up" after itself, leaving no trace at all that it has been in use, except for {VAR 1} through {VAR 7} and the "block buffer." The "tape" within this buffer should be retrieved and saved to disk if you have some future use for its contents (e.g., to check for typos, etc.).

This "doc" file is meant to fully document this version of 51CALC although this file is only the model from which I carved from a larger macro I had earlier created. Work on that version is presently suspended, but work is resumed and it has been completed, it will include additional features.

51CALC accepts the mnemonic letters and symbols ("a" for "add" (or "+"), "d" for "divide" (or "/") and so forth), as well as the keypad gray "+" and "-" keys.

Inputting numbers into 51CALC is relatively simple. When first invoked, it thereafter permits you to push a letter which corresponds to the variable you desire to use/change and press the ENTER key. Using the mathematical operators, you will at all times be calcalating the result of two variables. If, for example, you use the addition operator at start-up, 51CALC will continue to perform addition in subsequent calculations until you explicitly select the appropriate letter and select some other operator. An example of the prompts alongside which numbers are inputting into 51CALC follows.

Okay? Y

A 386

B +

C 114

The ease with which typographical error can be corrected from within 51CALC is worthy of mention as well. Mistakes when typing a series of many-digit numbers can easily be made, but, as in the following series of calculations, please note how easy it is to correct them.

330,485 .00

+	29,600 .00

--------------------

360,085 .00

6,200 .00

--------------------

366,285 .00

4,980 .00

--------------------

371,265 .00

9,060 .00

--------------------

380,325 .00

6,037 .50

--------------------

386,362 .50

16,760 .01

16,760 .00

--------------------

403,122 .50

*

1 .065

--------------------

429,325 .46

-

403,122 .50

--------------------

26,202 .96

Take notice that the "tape" reflects a series of calculations using the addition operator.

Following these is a calculation produced by using the multiplication operator which add 6.5% (sales tax) to the total. Lastly, there is a calculation which yields as a result the amount of sales tax on the figure $429,325.46 (the difference) by means of the subtraction operator.

Note, however, that there appears to have been a calculation involving three different numbers instead of two. Actually, the third number (16,760.00) is a correction of the second number (16,760.01). This number did not really have to be retyped as 51CALC always "remembers" the last two numbers entered into it. The number stored and display alongside 51CALC's "A" variable is saved to WP 5.1's Alt-2

{VAR}able; the number stored in the "B" variable is saved to the Alt-3 variable. Therefore, all that was necessary (and was done) in this case was that, at the "Okay? Y" prompt, "B" was pressed and the Alt-3 variable was pressed. Then, by after hitting the {Backspace} key once, the correct number (a "0") was typed.

Once you get the hang of inputting numbers into 51CALC, you'll no doubt use it to calculate relative short lists of numbers you may from time to time have need to do in connection with your work.

Should you wish to see how this macro was written, you may use WP 5.1's internal macro editor. (I usually write a macro, then try to trim it so as to reduce its size and its speed of execution. Some of the code is redundant, but the process of trimming macros can be time-consuming as this one was, especially as this was merely a functional model of a more feature-packed version yet to be completed.)

51CALC is Shareware

Should 51CALC prove useful to you (and I believe to many of you it will), consider registering your copy with me by sending $10 (U.S.) to:

Karl M. Rowe

Consultant

6301 Sunset Boulevard #101-62

Los Angeles, CA 90028

51CALC is being distributed through public access channels in order that prospective buyers may evaluate the product before making a decision to buy. In that way, should it not meet your needs, you won't be using it, and so you won't have to write me to refund a price you never paid (I hope). But if it does prove helpful to you in some way, you will want to pay the small fee I ask in view of the benefits you obtain from it.

51CALC is NOT public domain software; therefore, please don't think it a product you may use without obligation to purchase it. It is protected by federal and state copyright laws and fully supported by me. If you really like 51CALC, the $10 registration fee can be sent in cash, check or money order, to the address above. (The latter two are best, however, secure and traceable.) Please supply both your name and mailing address for, unless such is contained on your personal check, it will be impossible to know who you are. You are free to copy and distribute 51CALC for noncommercial use provided you charge no fee for its use, its copying or its distribution, provided all five (5) files from the WPCALC.ARC file (listed above), which includes this documentation file, are distributed together, and provided you not modify it in any way, except as set forth above.

Bona fide computer user groups or clubs may make copies of 51CALC for distribution to members for a small fee sufficient to cover any copying or administrative expense its bears. BBS's that operate through subscription fees may also post 51CALC for downloading by its subscribers. Make as many back-up copies as you please, but, again, no fee is to be charged for distributing 51CALC.

Concerns that customarily charge fees for either the shareware and/or public domain software they distribute are specifically prohibited from distributing 51CALC individually or in connection with the packaging thereof with other disk or promotion, in any other form, or at any price. Volume discounts, site and commercial licenses are available. No warranty, either expressed or implied, is provided with this product and is being provided on an "as is" basis.

If you have any questions, you may feel free to E-Plex or post a message to me on CompuServe, or you may write me at:

Karl M. Rowe, Consultant

6301 Sunset Boulevard #101-62

Los Angeles, CA 90028

#73100,3602

AKNOWLEDGEMENT

Many thanks to James McKeown, Ph.D., whose "Using Math" chapter contained in the first printing of book Using WordPerfect 5 by Charles O. Stewart, III, et al. (1988 Que Corp., 1988), was of valuable assistance to me in my coming to appreciate more fully the "how" of WP 5.0's Math Feature, which feature is retained in WP 5.1. Dr. McKeown is a member and an active participant of the WordPerfect Support Group Forum (#70007,3441).

Thanks also to Alan Kaplan whose many helpful suggestions became part of WP5 CALC (a macro similar to 51CALC, except written for WP 5.0) and are included as well in this version (WP5 CALC [for WP 5.0] and 51CALC [for WP 5.1] are version-specific macros and cannot be run interchangeably on incompatible versions. Mr. Kaplan is a member and an active participant of the WordPerfect Support Group Forum (#73100,3602).