home *** CD-ROM | disk | FTP | other *** search
/ Megazine / Megazine-1.iso / PROGRAMA / CLIPPER / CALC223 / CALC.TXT < prev    next >
Encoding:
Text File  |  1994-01-24  |  71.9 KB  |  2,693 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  (c) Copyright 1991-94 Touchstone Business Creations, All rights reserved
  7. ──────────────────────────────────────────────────────────────────────────────
  8.  
  9.  
  10.                                       CALC
  11.  
  12.                   The Professional Calculator for Clipper (tm)
  13.                                        by
  14.                          Touchstone Business Creations
  15.  
  16.  
  17.  
  18.                                   Version 2.2
  19.  
  20.                                   January 1994
  21.  
  22.  
  23.  
  24.                (c) Copyright 1991-94 Touchstone Business Creations,
  25.                               All rights reserved.
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  Credits
  33. ──────────────────────────────────────────────────────────────────────────────
  34.  
  35.   The Professional Calculator for Clipper (tm) was written and produced
  36.   by Jim Gale of Touchstone Business Creations.
  37.  
  38.   The CALC and all included functions are written entirely in Clipper 5.x;
  39.   however, one additional function has been added to the CALC.LIB taken
  40.   from the public domain library called NANFOR.LIB.  The function is
  41.   FT_NUMLOCK() which allows CALC to get/set the status of the numlock.
  42.   This is written in C and was added to CALC.LIB under the same name to
  43.   prevent function duplication for developers who use NANFOR.LIB.
  44.  
  45.   Thanks to Ted Means for his donation of FT_NUMLOCK() to NANFOR.LIB and
  46.   to Glenn Scott for the production of NANFOR.LIB.
  47.  
  48.   Also, special thanks to the current users of CALC that have sent in
  49.   their requests for desired abilities.
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  Changes
  60. ──────────────────────────────────────────────────────────────────────────────
  61.  
  62.    The Professional Calculator for Clipper (tm)
  63.  
  64. Version 1.0    -  5/91   Initial release tested on CompuServe
  65.    Rev  1.1,1.2-  6/91   Bug fixes
  66.  
  67.    Rev  1.3    -  6/91   Clean version with DOUBLE lines in calculator
  68.                            with NG file.
  69.  
  70.    Rev  1.4    -  9/91   Changed to SINGLE lines for international compat.
  71.  
  72.    Rev  1.5    -  9/92   Added positioning CalcPos(), code block exception
  73.                            handling, CalcMemory() to access memory directly,
  74.                            paper scrolling, better NG docs.
  75.  
  76.    Rev  1.51   -  4/93   Changed Address/Phone, Compiled under Clipper 5.2
  77.  
  78.    Rev  1.6    -  4/93   Added Network Printing functions CalcPrint() and
  79.                            CalcPTape(). Calc also compiled under 5.2.
  80.  
  81. Version 2.0    - 10/93   Added Mouse Support, English/Spanish ability, and
  82.                            Trigonometry functions.  Also tested and made
  83.                            all functions protected mode compatible.
  84.  
  85.    Rev  2.1    - 12/93   Added CALCDEC()
  86.  
  87.    Rev  2.2    -  1/94   Added German.
  88.  
  89.  Registration Form
  90. ──────────────────────────────────────────────────────────────────────────────
  91.  
  92.                                      ORDER FORM
  93.  
  94.      Make and send CHECK or MONEY ORDER payable to:
  95.  
  96.  
  97.      TO:  Touchstone Business Creations
  98.           28613 River Glen Ct. #1
  99.           Menifee, CA 92584-8987
  100.           (909) 679-3364
  101.           CompuServe #: 73670,2561
  102.  
  103.  
  104.      From:  Full Name:               ____________________________________
  105.  
  106.             Company Name (if any):   ____________________________________
  107.  
  108.             Street Address:          ____________________________________
  109.  
  110.             City, State, Zip:        ____________________________________
  111.  
  112.             Country:                 ____________________________________
  113.  
  114.             VOICE Phone:             ____________________________________
  115.  
  116.             FAX Phone:               ____________________________________
  117.  
  118.             CompuServe #:            ____________________________________
  119.  
  120.  
  121.      Desired Registration & Disk:
  122.  
  123.      CALC ver 2.1 Registration only:          $69.95 x Qty____ =  $_____
  124.  
  125.      CALC Disk (if necessary) (SPECIFY TYPE)  $5                  $_____
  126.       circle one:    3 1/2"    5 1/4"
  127.  
  128.      California residents, add sales tax for Riverside county     $_____
  129.       (currently 7.75% - adjust if necessary)
  130.  
  131.                                               ---------------------------
  132.  
  133.      TOTAL Enclosed:                                              $_____
  134.  
  135.      When you register, we will send you your registration number to use in
  136.      your program to inhibit the copyright notice.  This will be a simple
  137.      one sheet letter.  If you require the disks sent to you, there is an
  138.      additional $5  charge for postage, handling and material (listed above).
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  Purpose, Trademarks, Technical Support...
  146. ──────────────────────────────────────────────────────────────────────────────
  147.  
  148.          1.1 Purpose
  149.  
  150.               CALC has been developed for the programmer, to add a
  151.          natural, yet powerful calculator to her application.  CALC
  152.          works with the Clipper 5.x development system on IBM
  153.          compatible computers.
  154.  
  155.          1.2 Trademarks.
  156.  
  157.          Clipper is a registered trademark of Computer Associates,
  158.             International, Inc.
  159.          IBM is a registered trademark of International Business
  160.             Machines.
  161.  
  162.          1.3 Technical Support.
  163.  
  164.               As a registered user, you retain the right to technical
  165.          support regarding CALC's use for a period of 45 days from
  166.          purchase.  After this, your support is at the discretion
  167.          of the technical supervisor at Touchstone Business Creations.
  168.  
  169.                To receive technical support:
  170.  
  171.                You may send your questions, requests, and other
  172.                important information to CompuServe address 73670,2561
  173.  
  174.                or call
  175.                Touchstone Business Creations
  176.                at (909) 679-3364
  177.  
  178.                or write Touchstone at
  179.                28613 River Glen Ct. #1
  180.                Menifee, CA 92584-8987
  181.  
  182.          Be sure to have your registration number at hand (or if
  183.          writing, include it, please).
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  License and Royalty Agreements
  191. ──────────────────────────────────────────────────────────────────────────────
  192.  
  193.          1.4 License Agreement.
  194.  
  195.          1.4.1 License
  196.               Touchstone Business Creations ("Touchstone") grants you
  197.          a non-exclusive license of unlimited duration to use the
  198.          Touchstone Software Programs, Documentation and Permitted
  199.          Copies ("Software") as specified in the agreement.  This
  200.          agreement specifically does not grant you any rights to patents,
  201.          copyrights, trade secrets and trademarks.
  202.  
  203.          1.4.2 Runtime
  204.               You may distribute the Software in your executable programs
  205.          without any additional license from Touchstone provided that no
  206.          part of the software can be separated in whole or in part from
  207.          your executable program.  You may not distribute the Software as
  208.          part of a Runtime Link Library ("RTL"), a Dynamic Link Library
  209.          ("DLL") or a similar runtime system.
  210.  
  211.          1.4.3 Copyright
  212.               You acknowledge and agree that the Software (including
  213.          permitted copies) is owned by Touchstone and its suppliers.
  214.          This Software is protected by United States copyright law and
  215.          international treaty provisions.  You agree to safeguard the
  216.          Software as copyrighted material.
  217.  
  218.          1.4.4 Permitted Use
  219.          You may use the Software on a single computer or terminal at a
  220.          time.  Each user of the Software must have their own licensed copy.
  221.          Provided the copy is exact (including copyright notices and serial
  222.          numbers) you may make copies of the diskette(s) for backup or
  223.          achival purposes only.  We recommend that you do this.  In addition
  224.          you may transfer one copy of the information on the diskette(s) to
  225.          a single hard disk provided that you keep and use the original
  226.          diskette(s) solely for backup or archival purposes.  You may
  227.          transfer your rights under this agreement on a permanent basis
  228.          provided that you transfer all the Software and the recipient
  229.          agrees to the terms of this agreement.  Any transfer must include
  230.          the most recent update and all prior versions.  Transfer of
  231.          out-of-date or obsolete versions of the software is expressly
  232.          prohibited.
  233.  
  234.          1.4.5 Restrictions on use
  235.          You may not network the Software or otherwise use it on
  236.          more than one computer or terminal at the same time.
  237.          You may not loan, sublicense, rent, lease, sublease, or otherwise
  238.          transfer any right to use the Software.
  239.          You may not make copies of the Software, or any portion thereof,
  240.          except as specifically provided in this agreement.  You may not
  241.  
  242.  
  243.  
  244.  
  245.          reproduce, transmit, transcribe, store in a retrieval system, or
  246.          translate into any language the Software or any part thereof.
  247.          You may not, under any circumstances, copy the documentation
  248.          supplied with the Software.
  249.          You may not disassemble, decompile, reverse engineer or create
  250.          derivative works based on the software or any portion therof.
  251.          You acknowledge that the structure and organization of the
  252.          Software are the valuable trade secrets of Touchstone.
  253.          You agree to hold such trade secrets in confidence.
  254.  
  255.          1.4.6 Limited warranty
  256.               The software is provided "as is" and without warranty of
  257.          any kind.
  258.          Touchstone does warrant the diskette(s) on which the Software is
  259.          recorded shall be free from defects in materials and workmanship
  260.          under normal use and service for a period of thirty days from date
  261.          of delivery of this package as evidenced by a copy of your receipt.
  262.          To execise your rights under this warranty you must return the
  263.          defective material to Touchstone at your expense within the
  264.          warranty period or first notify Touchstone in writing within the
  265.          warranty period that you have found a defect and return the
  266.          material immediately thereafter to Touchstone at your expense.
  267.          Touchstone's liability and your exclusive remedy and sole measure
  268.          of recoverable damages under the foregoing warranty for any
  269.          diskettes which are determined to be defective shall be,
  270.          at Touchstones options (1) return of the price paid, or (2)
  271.          repair or replacement of the defective materials.  In the event
  272.          of replacement of a diskette, the replacement will be warranted
  273.          for the remainder of the thirty days or fourteen days, whichever
  274.          is longer.
  275.          THIS WARRANTY AS SET FORTH ABOVE IS THE ONLY WARRANTY OF ANY KIND,
  276.          EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THE SOFTWARE, INCLUDING,
  277.          BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
  278.          ORIGINALITY OR FITNESS OF A PARTICULAR PURPOSE.
  279.  
  280.          1.4.7 Limitation of liability
  281.               NEITHER TOUCHSTONE NOR ANYONE WHO HAS BEEN INVOLVED IN THE
  282.          CREATION, PRODUCTION, OR DELIVERY OF THE SOFTWARE SHALL BE LIABLE
  283.          FOR ANY LOST PROFITS OR ANY INCIDENTAL, INDIRECT, CONSEQUENTIAL,
  284.          EXEMPLARY OR SPECIAL DAMAGES OR COSTS (INCLUDING LEGAL EXPENSES,
  285.          OR LOSS OF GOODWILL) ARISING OUT OF OR RELATING TO THE USE OF,
  286.          THE RESULTS OF, OR THE INABILITY TO USE THE SOFTWARE, EVEN IF
  287.          TOUCHSTONE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
  288.          OR CLAIM.
  289.  
  290.          1.4.8 Indemnity
  291.               You agree to indemnify and defend Touchstone from and against
  292.          any and all claims, suits, damages, and expenses (including legal
  293.          expenses) brought against or suffered by Touchstone Business
  294.          Creations as a result of and failure or malfunctions of an
  295.          application within which or into which you have compiled or
  296.          incorporated the Software and/or the Software runtime modules.
  297.  
  298.  
  299.  
  300.  
  301.  
  302.          1.4.9 US Government Restricted Rights
  303.               The Software and documentation are supplied with restriced
  304.          rights.  Use, duplications or a disclosure by the Government is
  305.          subject to restrictions as set forth in subparagraph (c) (1) (ii)
  306.          of the rights in Technical Data and Computer Software Clause
  307.          at DFARS 252.227-7013 or subparagraphs (c) (1) and (2) of the
  308.          Commercial Computer Software - restricted Rights at 48 CFR
  309.          52.227-19, as applicable.  Contractor/manufacturer is
  310.          Touchstone Business Creations, 28613 River Glen Ct. #1,
  311.          Menifee, CA 92584-8987.
  312.  
  313.          1.4.10 Updates
  314.               Touchstone reserves the right, at its sole discretion, to
  315.          change, modify or update the Software at any time without the
  316.          obligation of notifying anyone.  Touchstone reserves the right
  317.          to offer updates to the Software either free of charge or for
  318.          an additional charge.  In order to be eligible to obtain updates
  319.          or information on updates you must complete and return the
  320.          supplied registration card to Touchstone.
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  Coming Attractions
  329. ──────────────────────────────────────────────────────────────────────────────
  330.  
  331.          1.5 Coming Attractions!
  332.  
  333.               Other products to be released soon are:
  334.  
  335.          Calendar() -pop-up full-featured calendar, scroll through
  336.          days, months, years, see and set holidays, calculate no. of
  337.          work days, and upon pressing Ctrl-Enter transfers date back
  338.          to date field.
  339.  
  340.          Demo & Security Library -make your executable as safe as
  341.          can be from copy protection.  These methods are already being
  342.          used in the industry.  Now you can have them in your program.
  343.  
  344.          Games Library -while your computer works (indexing, or
  345.          report building), you can be playing games with your computer.
  346.          These "extras" give your program a well-rounded feel.
  347.  
  348.          MUCH MORE!   Register to receive all notices & updates!
  349.  
  350.          * Please express your interest and specific wishes for these
  351.            and other products. *
  352.  
  353.          ** REGISTERED USERS OF CALC WILL RECEIVE DISCOUNTS TOWARDS **
  354.          **    ANY OTHER TOUCHSTONE BUSINESS CREATIONS PRODUCT      **
  355.  
  356.  
  357.  Calculator Functions:
  358.  
  359.  
  360.  CALCINIT()
  361.  To set the calculator colors or a set of colors to recognize and replace.
  362. ──────────────────────────────────────────────────────────────────────────────
  363.  
  364.  Syntax
  365.  
  366.       CALCINIT( [<caColors>] )  -> NIL
  367.  
  368.  Arguments
  369.  
  370.       <caColors> may be a character color value, an array of colors,
  371.       or other data type.
  372.  
  373.       Defaults to NIL (automatically setting the colors to "W+/B" on a
  374.        color adapter)
  375.  
  376.  Returns
  377.  
  378.       CALCINIT() always returns NIL
  379.  
  380.  Description
  381.  
  382.       You may use CALCINIT() to set the calculator colors or to search
  383.       and replace set of colors, or to default to current colors.
  384.  
  385.       Regarding the parameter <caColors>:
  386.  
  387.       ■ If it is a character color value, it must be in the standard color
  388.         format (i.e. "W+/R") (SEE EXAMPLE 1)
  389.  
  390.       ■ If it is an array, it must be two dimensional, the first to search
  391.         and match the current colorset (it must contain one comma);
  392.         the second to set the color upon finding a match (SEE EXAMPLE 2)
  393.  
  394.       ■ If it is NIL (the default), it will set the calculator colors to "N/W"
  395.         (SEE EXAMPLE 3)
  396.  
  397.       ■ If it is any other data type (such as logical), it will keep the
  398.         colors that it was called with (SEE EXAMPLE 4)
  399.  
  400.  Examples
  401.  
  402.      ** Example 1 - character parameter
  403.  
  404.         CALCINIT( "W+/R" )  // calculator will now operate as white on red
  405.         Calculator()
  406.  
  407.  
  408.  
  409.  
  410.  
  411.      ** Example 2 - array
  412.  
  413.         aColors :=  {   {"W+/N," , "N/W" } ,;   //color must include comma
  414.                         {"R+/B," , "B+/R"} ,;
  415.                         {""      , "W/N" }   }  //all non-matched colors
  416.                                                 // will match with ""
  417.  
  418.         CalcInit( aColors )
  419.  
  420.         The above example will (upon calling the calculator), check the
  421.         current color against "W+/N," and, if found, set the color to "N/W".
  422.         If not, will compare against "R+/B," and, if found set the color to
  423.         "B+/R".  If neither is found, the "" will be matched and the color
  424.         set to "W/N".
  425.  
  426.  
  427.      ** Example 3 - NIL  (default)
  428.  
  429.         CalcInit(NIL)       // or never issuing a CalcInit()
  430.  
  431.         SetColor("W/R")
  432.         Calculator()        // this will operate the calculator in the default
  433.                             //  color of W/R
  434.  
  435.  
  436.      ** Example 4 - other, (logical)
  437.  
  438.         CalcInit(.T.)
  439.  
  440.         SetColor("W/R")
  441.         Calculator()        // this will operate the calculator in W/R
  442.  
  443.  
  444.  
  445.  Files: CALC.LIB
  446.  
  447.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  448.          28613 River Glen Ct. #1
  449.          Menifee, CA 92584-8987 USA
  450.  
  451.          (909) 679-3364
  452.  
  453.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  454.    See Also: CALCPOS() CALCUDF() CALCULATOR() CALCREG()
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  CALCPOS()
  462.  To get/set the calculator initial screen position.
  463. ──────────────────────────────────────────────────────────────────────────────
  464.  
  465.  Syntax
  466.  
  467.       CALCPOS( [<aPosition>] )  -> aOldPosition
  468.  
  469.  Arguments
  470.  
  471.       <aPosition> is an optional array parameter containing {<nRow>,<nCol>}.
  472.  
  473.       If you specify an empty array ({}), CALCPOS() will default the
  474.       calculator position to the following:
  475.  
  476.       Defaults to {} (automatically setting the position to a row of
  477.        MaxRow()-12, and the column to 0 if your cursor is >=40
  478.        or to MaxCol()-24 if your cursor is <40).
  479.  
  480.  Returns
  481.  
  482.       CALCPOS() returns the current CALCPOS() array setting of {<nRow>,<nCol>}.
  483.  
  484.  Description
  485.  
  486.       You may use CALCPOS() to get/set the calculator initial screen
  487.       position.
  488.  
  489.       Regarding the parameter <aPosition>:
  490.  
  491.       ■ If it is an empty array (the default), it will set
  492.         the row to MaxRow()-12, and the column to 0 if your current
  493.         screen cursor position is greater than or equal to 40,
  494.         or to MaxCol()-24 if your cursor is less than 40.
  495.         ( i.e. CALCPOS({}) )
  496.  
  497.  Examples
  498.  
  499.      ** Example 1 - array with positions
  500.  
  501.         //Positions the initial display of
  502.         //the calculator at MaxRow()-13,4.
  503.         aOldPos := CALCPOS( MaxRow()-13, 4 )
  504.  
  505.         Calculator()
  506.  
  507.  
  508.  
  509.  
  510.  
  511.      ** Example 2 - empty array
  512.  
  513.         aOldPos := CALCPOS( {} )
  514.  
  515.         Calculator()
  516.  
  517.         Defaults the row to MaxRow()-12 and the col to
  518.           If( Col() > (MaxCol()+1)/2, 0, MaxCol()-24 )
  519.  
  520.  
  521.  Files: CALC.LIB
  522.  
  523.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  524.          28613 River Glen Ct. #1
  525.          Menifee, CA 92584-8987 USA
  526.  
  527.          (909) 679-3364
  528.  
  529.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  530.    See Also: CALCINIT() CALCUDF() CALCULATOR() CALCREG()
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  CALCDEC()
  539.  To get/set the calculator predefined decimal positions.
  540. ──────────────────────────────────────────────────────────────────────────────
  541.  
  542.  Syntax
  543.  
  544.       CALCDEC( [<nDecimals>] )  -> aOldDecimals
  545.  
  546.  Arguments
  547.  
  548.       <nDecimals> is an optional numeric parameter containing decimals
  549.       to set for calculator operation.
  550.  
  551.       Defaults to -2 (automatically setting the decimals to whatever it
  552.        receives through the get variable or the initialization parameter)
  553.  
  554.  Returns
  555.  
  556.       CALCDEC() returns the current CALCDEC() numeric setting.
  557.  
  558.  Description
  559.  
  560.       You may use CALCDEC() to get/set the calculator predefined decimal
  561.       positions.
  562.  
  563.       Regarding the parameter <nDecimals>:
  564.  
  565.       ■ In the range zero to nine (0-9), it will FIX the decimals to
  566.         that number, regardless of how it was received.
  567.  
  568.       ■ If it is a -1, it will FLOAT the decimals, regardless of how
  569.         it was received.
  570.  
  571.       ■ If it is a -2, it will be floating unless the received value
  572.         contains a decimal position in which it will fix that position.
  573.         (This is the default behavior)
  574.  
  575.  
  576.  
  577.  
  578.  Examples
  579.  
  580.      ** Example 1 - set decimals to 2
  581.  
  582.         //Positions the calculator to two decimals
  583.  
  584.         nOldDec := CALCDEC( 2 )
  585.  
  586.         Calculator(1.23456)       //shows 1.23 only!
  587.  
  588.  
  589.      ** Example 2 - set decimals to 0
  590.  
  591.         //Positions the calculator to no decimals
  592.  
  593.         nOldDec := CALCDEC( 0 )
  594.  
  595.         Calculator(1.23456)       //shows 1 only!
  596.  
  597.  
  598.      ** Example 3 - set decimals to FLOATING
  599.  
  600.         //Positions the calculator to floating decimal
  601.  
  602.         nOldDec := CALCDEC( -1 )
  603.  
  604.         Calculator(1.23456)       //shows 1.23456 without being fixed.
  605.  
  606.  
  607.      ** Example 4 - set decimals to DEFAULT
  608.  
  609.         //Positions the calculator to default behavior
  610.  
  611.         nOldDec := CALCDEC( -2 )
  612.  
  613.         Calculator(1.23456)       //shows 1.23456 fixed!
  614.         Calculator(1)             //shows 1       floating!
  615.  
  616.  
  617.  
  618.  Files: CALC.LIB
  619.  
  620.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  621.          28613 River Glen Ct. #1
  622.          Menifee, CA 92584-8987 USA
  623.  
  624.          (909) 679-3364
  625.  
  626.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  627.    See Also: CALCULATOR()
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  CALCUDF()
  635.  To get/set the calculator key handler block.
  636. ──────────────────────────────────────────────────────────────────────────────
  637.  
  638.  Syntax
  639.  
  640.       CALCUDF( [<bCalcUDF>], [<lAllKeys>] )  -> bOldCalcUDF
  641.  
  642.  Arguments
  643.  
  644.       <bCalcUDF> is an optional block parameter containing a code block
  645.       to evaluate upon (0) initialization, (1) operational keys,
  646.       (2) keyboard exceptions, and (3) termination.  DEFAULTS TO NIL.
  647.  
  648.       <lAllKeys> is an optional logical parameter denoting whether to
  649.       call the code block upon operational keys (i.e. not only keyboard
  650.       exceptions). DEFAULTS TO FALSE.
  651.  
  652.  Returns
  653.  
  654.       CALCUDF() returns the current CALCUDF() code block.
  655.  
  656.  Description
  657.  
  658.       You may use CALCUDF() to get/set the calculator key handler block.
  659.  
  660.       Regarding the code block <bCalcUDF> (If it is not NIL):
  661.  
  662.       ■ Will be evaluated with 7 parameters:
  663.  
  664.          ■ Procedure name (always CALCULATOR)
  665.          ■ Version number (always 21 in version 2.1)
  666.          ■ The variable name when the Calculator hotkey was pressed or NIL
  667.          ■ Numeric representation of the current display
  668.          ■ Character representation of the current display
  669.          ■ Numeric mode (0=initialization call, 1=a key was pressed,
  670.              2=key exception, 3=termination)
  671.          ■ Character representation of the current calculator color
  672.          ■ Numeric representation of the last key pressed
  673.              (valid for mode #1 and 2 only) (same as LastKey())
  674.  
  675.       ■ Will send as the 6th parameter the numeric mode:
  676.  
  677.          0 = called upon entering the calculator
  678.              (best time to set up your own help screen for your keys)
  679.  
  680.          2 = called upon a key exception (a key not recognized by
  681.              the calculator operation and no setkey exists)
  682.  
  683.          3 = called upon exiting the calculator
  684.              (best time to take down your help)
  685.  
  686.  
  687.  
  688.  
  689.  
  690.          (If <lAllKeys> is true, then mode 1 will be called,
  691.           else if will not be called):
  692.          1 = called upon any keypress in the calulator,
  693.              prior to executing any operation that the key represents
  694.  
  695.       ■ Return Values of the code block
  696.  
  697.          (The following applies to mode 0, 1, and 2 only - not 3):
  698.  
  699.          ■ If your code block returns a TRUE, the calcuator will immediately
  700.            return without further processing.
  701.  
  702.          ■ If your code block returns a NUMERIC, the calculator will
  703.            display the numeric as the last result of the calculator.
  704.  
  705.          ■ If your code block returns a CHARACTER, it will be "keyboarded"
  706.            into the calculator as if the user had typed it him/herself
  707.            (Be aware of the current SET TYPEAHEAD).
  708.  
  709.          ■ Any other data type will be ignored and processing will
  710.            continue normally.
  711.  
  712.  Examples
  713.  
  714.      ** Example
  715.  
  716.         Function Test()
  717.  
  718.         //Sets the UDF to call during the calculator
  719.         // but (.F.) do not call with ALL keys
  720.         bOldUDF := CALCUDF( {|x1,x2,x3,x4,x5,x6,x7,x8| ;
  721.                     MyCalcUDF(x1,x2,x3,x4,x5,x6,x7,x8) } , .F. )
  722.  
  723.         Calculator()
  724.  
  725.         RETURN NIL
  726.  
  727.  
  728.         Function MyCalcUDF(cProc,nVer,cVar,nValue,cValue,nMode,cColor,nKey)
  729.         Local xRetCode := .F.  //continue normally
  730.  
  731.            Do Case
  732.               Case nMode = 0   //Initialization call
  733.                  //put up extra help menu for *MY* keys & save screen
  734.  
  735.               Case nMode = 3   //Termination call
  736.                  //take down my help screen
  737.  
  738.               Case nMode = 2   //Key Exception call
  739.                  Do Case
  740.                     Case nKey == K_ALT_F2     //my Square Root
  741.                        xRetCode := SQRT(nValue)
  742.  
  743.  
  744.  
  745.  
  746.  
  747.                     Case nKey == K_ALT_T      //my add tax key!
  748.                        xRetCode := nValue * 1.0775
  749.  
  750.                     Case nKey == "~"          //my sign reverse key!
  751.                        xRetCode := -nValue
  752.  
  753.                     Case nKey == K_ALT_M      //my memory counter key!
  754.                        CalcMemory( CalcMemory()+1 )
  755.  
  756.                  Endcase
  757.  
  758.            Endcase
  759.  
  760.         Return xRetCode
  761.  
  762.      ───────────────────────────────────────────────────────────────────────
  763.       NOTE
  764.  
  765.      (When initially entering the calculator, or during keyboard calls):
  766.  
  767.          ■ If your code block returns a TRUE, it will immediately
  768.            abandon the calculator without further processing.
  769.  
  770.          ■ If your code block returns a NUMERIC, the calculator will
  771.            display the numeric as the last result of the calculator.
  772.  
  773.          ■ If your code block returns a CHARACTER, it will be "keyboarded"
  774.            into the calculator as if the user had typed it him/herself
  775.            (Be aware of the current SET TYPEAHEAD).
  776.  
  777.          ■ Any other data type will be ignored and processing will
  778.            continue normally.
  779.  
  780.      This NOTE does not apply to the call when exiting the calculator.
  781.      ───────────────────────────────────────────────────────────────────────
  782.  
  783.  
  784.  Files: CALC.LIB
  785.  
  786.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  787.          28613 River Glen Ct. #1
  788.          Menifee, CA 92584-8987 USA
  789.  
  790.          (909) 679-3364
  791.  
  792.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  793.    See Also: CALCPOS CALCINIT() CALCULATOR() CALCREG()
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  CALCMEMORY()
  801.  To get/set the calculator static memory.
  802. ──────────────────────────────────────────────────────────────────────────────
  803.  
  804.  Syntax
  805.  
  806.       CALCMEMORY( [<nNewMemory>] )  -> nOldMemory
  807.  
  808.  Arguments
  809.  
  810.       <nNewMemory> is an optional numeric parameter containing the
  811.       new value for the calculator memory functions (M+,M-,M*,M/,MR,MC).
  812.  
  813.  Returns
  814.  
  815.       CALCMEMORY() returns the current static memory value.
  816.  
  817.  Description
  818.  
  819.       You may use CALCMEMORY() to get/set the calculator static memory
  820.       value.
  821.  
  822.  Examples
  823.  
  824.      ** Example - adding to memory all sales
  825.  
  826.         //upon pressing ALT_M, the value+tax will be added to memory.
  827.  
  828.         SetKey(K_ALT_M,{|cProc,n1,c1,nValue| ;
  829.                If(cProc="CALCULATOR",CalcMemory( CalcMemory() +
  830.                (nValue * 1.0775) ),NIL)})
  831.  
  832.         Calculator()
  833.  
  834.  
  835.  Files: CALC.LIB
  836.  
  837.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  838.          28613 River Glen Ct. #1
  839.          Menifee, CA 92584-8987 USA
  840.  
  841.          (909) 679-3364
  842.  
  843.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  844.    See Also: CALCULATOR()
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  CALCPRINT()
  852.  To get/set the calculator printing status.
  853. ──────────────────────────────────────────────────────────────────────────────
  854.  
  855.  Syntax
  856.  
  857.       CALCPRINT( [<nNewStatus>] )  -> nOldStatus
  858.  
  859.  Arguments
  860.  
  861.       <nNewStatus> is an optional numeric parameter containing the new
  862.       printing status.
  863.  
  864.       If you specify 0, all printing will occur normally.
  865.       (When "Printing" is turned on, all lines will be printed as they are
  866.       entered).
  867.  
  868.       If you specify 1, all printing will be held until you exit the
  869.       calculator - then all lines will be printed at once.
  870.  
  871.       If you specify 2, all calculator printing will be held during the
  872.       entire execution of the application.  You must then specify
  873.       CalcPrint(-1) to force a print, or CalcPrint(-2) to cancel a print,
  874.       or CalcPrint(1) to allow the calculator to print all lines at the
  875.       end of the next use.
  876.  
  877.       If you specify 3, all printing will be suspended, and not kept
  878.       in memory.
  879.  
  880.       Defaults to 0 if no network is detected, or 1 is a network is detected.
  881.  
  882.  Returns
  883.  
  884.       CALCPRINT() returns the current CALCPRINT() printing status.
  885.  
  886.  Description
  887.  
  888.      ───────────────────────────────────────────────────────────────────────
  889.       NOTE
  890.  
  891.       Printing must be turned on by user pressing the "P" key during use
  892.       for any printing to occur.
  893.  
  894.      ───────────────────────────────────────────────────────────────────────
  895.  
  896.  
  897.  
  898.  
  899.       You may use CALCPRINT() to get/set the calculator printing status.
  900.  
  901.       Regarding the parameter <nNewStatus>:
  902.  
  903.       ■ If it is 0, all printing will occur normally.  After the user
  904.         presses "P" to begin printing, each line will be sent to the
  905.         printer whenever the paper scrolls.
  906.         (NON-NETWORK DEFAULT)
  907.  
  908.       ■ If it is 1, all printing will be held until the user exits the
  909.         calculator.  At that time, all lines (during that specific use
  910.         of the calculator) will be printed.  The tape is then purged
  911.         and recording starts again at the next iteration.
  912.         (NETWORK DEFAULT)
  913.  
  914.       ■ If it is 2, all printing will be held throughout the execution
  915.         of the application regardless of how many times the user enters
  916.         and exits the calculator.
  917.  
  918.         To affect printing while in this status, you may:
  919.  
  920.            ■ Call CALCPRINT(-1) with the -1 parameter:
  921.              This will force a print of the tape and purge it for the
  922.              next or current use.
  923.  
  924.            ■ Call CALCPRINT(-2) with the -2 parameter:
  925.              This will purge the tape for the next or current use.
  926.  
  927.            ■ Call CALCPRINT(1) with the 1 parameter:
  928.              This will 'tell' the Calculator to print the tape at the
  929.              end of the next or current use of the calculator.
  930.  
  931.              ───────────────────────────────────────────────────────────────
  932.               NOTE
  933.  
  934.              The current CALCPRINT() status DOES NOT CHANGE if you call it
  935.              with a -1 or -2.  For example, if you first issue CalcPrint(2)
  936.              and later print the tape by issuing CalcPrint(-1), if you then
  937.              print the status ( ? CalcPrint() ), it will return a 2.
  938.  
  939.              ───────────────────────────────────────────────────────────────
  940.  
  941.  
  942.      ───────────────────────────────────────────────────────────────────────
  943.       NOTE
  944.  
  945.       Although highly unlikely, if the length of the calculator tape exceeds
  946.       32,000 characters, it will cease to record further lines until purged.
  947.  
  948.      ───────────────────────────────────────────────────────────────────────
  949.  
  950.  Examples
  951.  
  952.      ** Example 1 - normal printing (line by line)
  953.  
  954.         CalcPrint(0)  //print each line as received
  955.         Calculator()
  956.  
  957.  
  958.  
  959.  
  960.      ** Example 2 - hold printing until end of each calculator use
  961.  
  962.         CalcPrint(1)  //hold until end of calculator
  963.         Calculator()  // (prints at end)
  964.  
  965.      ** Example 3 - hold printing indefinitely
  966.  
  967.         CalcPrint(2)  //hold printing until further commands change it
  968.         Calculator()  // (nothing is printed)
  969.  
  970.         ...
  971.  
  972.         CalcPrint(-1) //forces a complete print of all calculator uses
  973.      or CalcPrint(-2) //purges print tape in memory.
  974.  
  975.  Files: CALC.LIB
  976.  
  977.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  978.          28613 River Glen Ct. #1
  979.          Menifee, CA 92584-8987 USA
  980.  
  981.          (909) 679-3364
  982.  
  983.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  984.    See Also: CALCPTAPE
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  CALCPTAPE()
  992.  To get/set the calculator printing tape.
  993. ──────────────────────────────────────────────────────────────────────────────
  994.  
  995.  Syntax
  996.  
  997.       CALCPTAPE( [<cNewTape>] )  -> nOldTape
  998.  
  999.  Arguments
  1000.  
  1001.       <nNewTape> is an optional character parameter containing the new
  1002.       printing tape.
  1003.  
  1004.      ───────────────────────────────────────────────────────────────────────
  1005.       NOTE
  1006.  
  1007.       This IS NOT the scrolling tape found at the top of the calculator.
  1008.  
  1009.       This IS the tape accumulated by using a CALCPRINT(2) or CALCPRINT(1)
  1010.       printing status (See CALCPRINT).
  1011.  
  1012.      ───────────────────────────────────────────────────────────────────────
  1013.  
  1014.  Returns
  1015.  
  1016.       CALCPTAPE() returns the current calculator printing tape. (This tape
  1017.       will be printed according to the current CALCPRINT printing status).
  1018.  
  1019.  Description
  1020.  
  1021.      ───────────────────────────────────────────────────────────────────────
  1022.       NOTE
  1023.  
  1024.       Printing must be turned on by user pressing the "P" key during use
  1025.       for any printing to occur.
  1026.  
  1027.      ───────────────────────────────────────────────────────────────────────
  1028.  
  1029.       You may use CALCPTAPE() to get/set the calculator printing status.
  1030.  
  1031.       Regarding the tape:
  1032.  
  1033.       ■  Each line is separated by a CRLF combination.
  1034.       ■  Each iteration (use) of the calculator is separated by a Chr(12)
  1035.          Eject character.
  1036.       ■  CALCPRINT(-1) forces a complete print and purge of the tape.
  1037.       ■  CALCPRINT(-2) purges the tape.
  1038.  
  1039.      ───────────────────────────────────────────────────────────────────────
  1040.       NOTE
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.       Although highly unlikely, if the length of the calculator tape exceeds
  1047.       32,000 characters, it will cease to record further lines until purged.
  1048.  
  1049.      ───────────────────────────────────────────────────────────────────────
  1050.  
  1051.  Examples
  1052.  
  1053.      ** Example 1 - Adding a Header
  1054.  
  1055.  
  1056.         CalcPrint(1)  //hold printing throughout use of the calculator.
  1057.  
  1058.         //Holds a header
  1059.         CalcPTape("Calculator 2.1 (c) Touchstone"+Chr(13)+Chr(10))
  1060.  
  1061.         Calculator()  // (printing is performed upon escape or exit)
  1062.  
  1063.      ** Example 2 - Print Tape Later
  1064.  
  1065.         CalcPrint(2)  //hold printing until further commands change it
  1066.         Calculator()  // (nothing is printed)
  1067.  
  1068.         ...
  1069.  
  1070.         //Adds a footer to the tape
  1071.         CalcPTape( CalcPTape()+" --- from Touchstone "+Chr(13)+Chr(10) )
  1072.  
  1073.         //Prints the complete tape (with footer)
  1074.         CalcPrint(-1)
  1075.  
  1076.  Files: CALC.LIB
  1077.  
  1078.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1079.          28613 River Glen Ct. #1
  1080.          Menifee, CA 92584-8987 USA
  1081.  
  1082.          (909) 679-3364
  1083.  
  1084.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1085.    See Also: CALCPRINT
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  CALCREG()
  1093.  To Register the On-screen Full-Function Calculator
  1094. ──────────────────────────────────────────────────────────────────────────────
  1095.  
  1096.  Syntax
  1097.  
  1098.       CALCREG( <nRegisteration> )  -> NIL
  1099.  
  1100.  Arguments
  1101.  
  1102.       <nRegisteration> is a numeric value representing your registration
  1103.       number.  This function will bypass the copyright screen on initial
  1104.       use of the calculator.
  1105.  
  1106.  Returns
  1107.  
  1108.       CALCREG() always returns NIL
  1109.  
  1110.  Description
  1111.  
  1112.       Use CALCREG() to register your calculator and prevent the copyright
  1113.       message from appearing on the initial call to the calculator.
  1114.  
  1115.  Requirements
  1116.  
  1117.       You must have a valid registration number.  You may obtain one from
  1118.       Touchstone Business Creations, 28613 River Glen Ct. #1, Menifee
  1119.       California 92584 USA.   The phone number is (909) 679-3364 .
  1120.  
  1121.  Examples
  1122.  
  1123.       CalcReg(12345)
  1124.  
  1125.  Files: CALC.LIB
  1126.  
  1127.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1128.          28613 River Glen Ct. #1
  1129.          Menifee, CA 92584-8987 USA
  1130.  
  1131.          (909) 679-3364
  1132.  
  1133.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1134.    See Also: CALCULATOR() CALCINIT()
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  CALCLANGUAGE()
  1142.  To Change the Calculator Language (ENGLISH/SPANISH/GERMAN)
  1143. ──────────────────────────────────────────────────────────────────────────────
  1144.  
  1145.  Syntax
  1146.  
  1147.       CALCLANGUAGE( <cNewLanguage> )  -> cOldLanguage
  1148.  
  1149.  Arguments
  1150.  
  1151.       <cNewLanguage> is a character value representing the language
  1152.       for the calculator to begin using whenever the next screens popup.
  1153.  
  1154.       NOTE: Only the first three letters of the passed parameter are
  1155.       used.
  1156.  
  1157.       Currently, the only valid values are:
  1158.  
  1159.           "ENG" (English)
  1160.       and "SPA" (Spanish)
  1161.       and "GER" (German)
  1162.  
  1163.  Returns
  1164.  
  1165.       CALCREG() returns the current language (either ENGLISH or SPANISH or
  1166.        GERMAN)
  1167.  
  1168.  Description
  1169.  
  1170.       Use CALCLANGUAGE() to set the language of the calculator for the
  1171.       help screen, printer messages, error messages, and other necessary
  1172.       keywords for complete calculator use.
  1173.  
  1174.       You can change the language at any time during use of the calculator.
  1175.       The messages *ALREADY ON-SCREEN* will not change. You need to cause
  1176.       the calculator to redisplay or exit and reenter.  For this reason,
  1177.       we suggest changing languages prior to calling the calculator.
  1178.  
  1179.  Advanced Notes
  1180.  
  1181.       If you wish to change the language *WHILE* using the calculator,
  1182.       there is a right way and wrong way to do it...
  1183.  
  1184.       The wrong way:
  1185.  
  1186.           SetKey(K_ALT_S, {|| CalcLanguage("SPA") })
  1187.           SetKey(K_ALT_E, {|| CalcLanguage("ENG") })
  1188.           SetKey(K_ALT_G, {|| CalcLanguage("GER") })
  1189.  
  1190.           This will fail because the function CalcLanguage() returns the
  1191.  
  1192.           of "SPANISH" or "ENGLISH".  Since the function was called from
  1193.           within the calculator... it will try to 'keyboard' the result
  1194.           into the calculator causing problems.
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.       The right way:
  1201.  
  1202.           SetKey(K_ALT_S, {|| CalcLanguage("SPA"),"" })
  1203.           SetKey(K_ALT_E, {|| CalcLanguage("ENG"),"" })
  1204.           SetKey(K_ALT_G, {|| CalcLanguage("GER"),"" })
  1205.  
  1206.           This will return a null string for the calculator to ignore.
  1207.  
  1208.  Examples
  1209.  
  1210.       CalcReg(12345)            //register your calculator
  1211.  
  1212.       CALCLANGUAGE( "SPANISH" ) //choose Spanish
  1213.  
  1214.       Calculator()              //call the calculator (or hotkey it)
  1215.  
  1216.  Files: CALC.LIB
  1217.  
  1218.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1219.          28613 River Glen Ct. #1
  1220.          Menifee, CA 92584-8987 USA
  1221.  
  1222.          (909) 679-3364
  1223.  
  1224.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1225.    See Also: CALCULATOR()
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  CALCULATOR()
  1233.  On-screen Full-Function Calculator
  1234. ──────────────────────────────────────────────────────────────────────────────
  1235.  
  1236.  Syntax
  1237.  
  1238.     CALCULATOR( [<nInitialValue>,] [<lAutoGrabAndPaste>] )  -> nResult
  1239.  
  1240.  Arguments
  1241.  
  1242.     <nInitialValue> is a numeric value which becomes the initial value
  1243.       to display in the calculator.
  1244.       Defaults to zero, unless called from a READMODAL numeric variable.
  1245.  
  1246.     <lAutoGrabAndPaste> is a logical value; if set to true, will attempt
  1247.       to grab from a numeric variable (if called from one) and will paste
  1248.       if exited by pressing Ctrl-Enter.  If, however, you have reason to
  1249.       prevent the numeric grabbing and the paste-back, set it to false.
  1250.       Defaults to whether (1) called from a numeric variable or (2) a numeric
  1251.       value was passed in <nInitialValue>.
  1252.  
  1253.  Returns
  1254.  
  1255.       A numeric result of the calculations.  If the user presses Ctrl-Enter
  1256.       to exit the Calculator, the keyboard will also be stuffed with the
  1257.       result.
  1258.  
  1259.  Description
  1260.  
  1261.       At its most basic use (SET KEY ... TO CALCULATOR) the calculator
  1262.       will pop up on screen (with a numeric if called from a get) allowing
  1263.       calculations, percentages, parenthesized calculations, memory (static),
  1264.       printing, fixed decimals, and a help screen.  When pressing
  1265.       Ctrl-Enter to exit, it will paste the result to your variable.
  1266.  
  1267.       In its more advanced use, you may set keys to do your own special
  1268.       functions and calculations (SET KEY K_F9 TO FINANCIAL), or train
  1269.       the calculator to search for and change to a separate color scheme,
  1270.       or call a special procedure before entering the calculator, or
  1271.       call the calculator as a function and return the result.
  1272.  
  1273.  Requirements
  1274.  
  1275.       You must call CalcReg( <nRegistration> ) to bypass the copyright screen.
  1276.       SEE CALCREG()
  1277.  
  1278.  
  1279.  Examples
  1280.  
  1281.    ** Example 1
  1282.  
  1283.       #include "inkey.ch"
  1284.  
  1285.       CalcReg(12345)                 // example registration number
  1286.       Set Key K_ALT_O to Calculator
  1287.  
  1288.       n1:=5
  1289.       c1:=Space(8)
  1290.  
  1291.       @ 5,5 Get n1
  1292.       @ 6,5 Get c1
  1293.       READ                            // press ALT_O for calculator
  1294.  
  1295.      ───────────────────────────────────────────────────────────────────────
  1296.  
  1297.    ** Example 2
  1298.  
  1299.       #include "inkey.ch"
  1300.  
  1301.       CalcReg(12345)
  1302.  
  1303.     // F5 will multiply n by 2 and return it (from calculator)
  1304.       SetKey(K_F5,{|p,l,v,n| If( p="CALCULATOR", n*2, NIL ) })
  1305.  
  1306.     // F6 will automatically keyboard any character returns,
  1307.     //  in this case, setting fixed decimals to 2
  1308.       SetKey(K_F6,{|p| If( p="CALCULATOR", "F2", NIL) })
  1309.  
  1310.     // F1 will call the calculator's help
  1311.       SetKey(K_F1,{|p| If( p="CALCULATOR", "H", NIL) })
  1312.  
  1313.       nResult := Calculator(5)        // pops up with a 5, returns a result
  1314.  
  1315.  
  1316.  Notes  (FOR ADVANCED USE)
  1317.  
  1318.       SETKEY PROCEDURES
  1319.  
  1320.          When it calls your set key procedure, it will pass five parameters:
  1321.  
  1322.          ■ Procedure name (always CALCULATOR)
  1323.          ■ Version number (always 21 in version 2.1)
  1324.          ■ The variable name when the Calculator hotkey was pressed or NIL
  1325.          ■ Numeric representation of the current display
  1326.          ■ Character representation of the current display
  1327.  
  1328.          When you return a result, it may be numeric, character, or other:
  1329.  
  1330.          ■ If you return a numeric, it will become the current display
  1331.  
  1332.          ■ If you return a character, it will be "keyboarded" as if the
  1333.            user typed it himself (be aware of your current SET TYPEAHEAD)
  1334.  
  1335.          ■ If you return any other value, it will be ignored
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  Keys Available:
  1342.  
  1343.            KEY    OPERATION
  1344.  
  1345.          ■  0-9   (standard numeric keys)
  1346.          ■  +,-,/,*  (standard arithmetic keys)
  1347.          ■  %     Perform percentage calculation
  1348.          ■  (     Begin a sub-calculation (may be nested)
  1349.          ■  )     End a sub-calculation
  1350.          ■  =     End a calculation (and all sub-calculations)
  1351.          ■[Enter] End a calculation (and all sub-calculations)
  1352.          ■[Bksp]  backup, erase last keystroke
  1353.          ■  AC    Clear all (except memory)
  1354.          ■  C     Clear Entry
  1355.          ■  H     Display calculator help.
  1356.          ■  P     Toggle printing; if printing is used, upon exit of the
  1357.                   calculator, a form feed will occur.
  1358.          ■  F n   Set fixed decimals to (n).  0-9 to fix, other key for
  1359.                   floating point.
  1360.          ■  M+    Add to memory  (static - will keep throughout program)
  1361.          ■  M-    Subtract from memory
  1362.          ■  M*    Multiply to memory
  1363.          ■  M/    Divide into memory
  1364.          ■  MR    Recall memory
  1365.          ■  MC    Clear memory
  1366.          ■ [Ctrl-Left / Ctrl-Right] Move Calculator
  1367.  
  1368.          ■ [Esc]  Exit calculator (do not paste)
  1369.          ■ [Ctrl-Enter]   Exit calculator (PASTE RESULT TO FIELD)
  1370.                           (applicable when called from a variable, or
  1371.                            when first parameter is numeric and second
  1372.                            parameter is true)
  1373.  
  1374.  Files: CALC.LIB
  1375.  
  1376.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1377.          28613 River Glen Ct. #1
  1378.          Menifee, CA 92584-8987 USA
  1379.  
  1380.          (909) 679-3364
  1381.  
  1382.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations.
  1383.    See Also: CALCREG() CALCINIT() CALCPOS() CALCUDF() CALCMEMORY()
  1384.  
  1385.  Trigonometrical Functions:
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  SIN()
  1394.  To return the SINE of a degree.
  1395. ──────────────────────────────────────────────────────────────────────────────
  1396.  
  1397.  Syntax
  1398.  
  1399.       SIN( <nDegree> ) -> nSin
  1400.  
  1401.  Arguments
  1402.  
  1403.       <nDegree> is a numeric value representing a degree value.
  1404.  
  1405.  Returns
  1406.  
  1407.       SIN() returns the sine value of <nDegree>.
  1408.  
  1409.  Description
  1410.  
  1411.       SIN() is a trigonometrical function that returns the sine value of
  1412.       a degree.
  1413.  
  1414.       For radians, see SINR().
  1415.  
  1416.       Accuracy is to the twelfth decimal (i.e. .00000000001)
  1417.  
  1418.  Examples
  1419.  
  1420.       ? Str( SIN(45), 11,  9)  // returns 0.707106781
  1421.       ? Str( SIN(60), 11,  9)  // returns 0.866025403
  1422.  
  1423.  Files: CALC.LIB
  1424.  
  1425.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1426.          28613 River Glen Ct. #1
  1427.          Menifee, CA 92584-8987 USA
  1428.  
  1429.          (909) 679-3364
  1430.  
  1431.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1432.    See Also: SINR() COS() TAN() ASIN() SEC()
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  SINR()
  1440.  To return the SINE of a radian.
  1441. ──────────────────────────────────────────────────────────────────────────────
  1442.  
  1443.  Syntax
  1444.  
  1445.       SINR( <nRadian> ) -> nSin
  1446.  
  1447.  Arguments
  1448.  
  1449.       <nRadian> is a numeric value representing a radian value.
  1450.  
  1451.  Returns
  1452.  
  1453.       SINR() returns the sine value of <nRadian>.
  1454.  
  1455.  Description
  1456.  
  1457.       SINR() is a trigonometrical function that returns the sine value of
  1458.       a radian.
  1459.  
  1460.       For degrees, see SIN().
  1461.  
  1462.       Accuracy is to the twelfth decimal (i.e. .00000000001)
  1463.  
  1464.  Examples
  1465.  
  1466.       nPI := PI()                  // returns 3.141592653589792
  1467.       ? Str( SINR(nPI/2), 11,  9)  // returns 1.000000000
  1468.       ? Str( SINR(nPI), 11,  9)    // returns 0.000000000
  1469.  
  1470.  Notes
  1471.  
  1472.  
  1473.  
  1474.  Files: CALC.LIB
  1475.  
  1476.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1477.          28613 River Glen Ct. #1
  1478.          Menifee, CA 92584-8987 USA
  1479.  
  1480.          (909) 679-3364
  1481.  
  1482.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1483.    See Also: SIN() COSR() TANR() ASINR() SECR()
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  COS()
  1491.  To return the COSINE of a degree.
  1492. ──────────────────────────────────────────────────────────────────────────────
  1493.  
  1494.  Syntax
  1495.  
  1496.       COS( <nDegree> ) -> nCos
  1497.  
  1498.  Arguments
  1499.  
  1500.       <nDegree> is a numeric value representing a degree value.
  1501.  
  1502.  Returns
  1503.  
  1504.       COS() returns the cosine value of <nDegree>.
  1505.  
  1506.  Description
  1507.  
  1508.       COS() is a trigonometrical function that returns the cosine value of
  1509.       a degree.
  1510.  
  1511.       For radians, see COSR().
  1512.  
  1513.       Accuracy is to the twelfth decimal (i.e. .00000000001)
  1514.  
  1515.  Examples
  1516.  
  1517.       ? Str( COS(45), 11,  9)  // returns 0.707106781
  1518.       ? Str( COS(60), 11,  9)  // returns 0.500000000
  1519.  
  1520.  Files: CALC.LIB
  1521.  
  1522.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1523.          28613 River Glen Ct. #1
  1524.          Menifee, CA 92584-8987 USA
  1525.  
  1526.          (909) 679-3364
  1527.  
  1528.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1529.    See Also: COSR() SIN() TAN() ACOS() CSC()
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  COSR()
  1537.  To return the COSINE of a radian.
  1538. ──────────────────────────────────────────────────────────────────────────────
  1539.  
  1540.  Syntax
  1541.  
  1542.       COSR( <nRadian> ) -> nCos
  1543.  
  1544.  Arguments
  1545.  
  1546.       <nRadian> is a numeric value representing a radian value.
  1547.  
  1548.  Returns
  1549.  
  1550.       COSR() returns the cosine value of <nRadian>.
  1551.  
  1552.  Description
  1553.  
  1554.       COSR() is a trigonometrical function that returns the cosine value of
  1555.       a radian.
  1556.  
  1557.       For radians, see COS().
  1558.  
  1559.       Accuracy is to the twelfth decimal (i.e. .00000000001)
  1560.  
  1561.  Examples
  1562.  
  1563.       nPI := PI()                  // returns  3.141592653589792
  1564.       ? Str( COSR(nPI/2), 12,  9)  // returns  0.000000000
  1565.       ? Str( COSR(nPI), 12,  9)    // returns -1.000000000
  1566.  
  1567.  Files: CALC.LIB
  1568.  
  1569.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1570.          28613 River Glen Ct. #1
  1571.          Menifee, CA 92584-8987 USA
  1572.  
  1573.          (909) 679-3364
  1574.  
  1575.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1576.    See Also: COS() SINR() TANR() ACOSR() CSCR()
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  TAN()
  1584.  To return the TANGENT of a degree.
  1585. ──────────────────────────────────────────────────────────────────────────────
  1586.  
  1587.  Syntax
  1588.  
  1589.       TAN( <nDegree> ) -> nTan
  1590.  
  1591.  Arguments
  1592.  
  1593.       <nDegree> is a numeric value representing a degree value.
  1594.  
  1595.  Returns
  1596.  
  1597.       TAN() returns the tangent value of <nDegree>.
  1598.  
  1599.  Description
  1600.  
  1601.       TAN() is a trigonometrical function that returns the tangent value of
  1602.       a degree.
  1603.  
  1604.       For radians, see TANR().
  1605.  
  1606.       Accuracy is to the twelfth decimal (i.e. .00000000001)
  1607.  
  1608.  Examples
  1609.  
  1610.       ? Str( TAN(45), 11,  9)  // returns 1.000000000
  1611.       ? Str( TAN(60), 11,  9)  // returns 1.732050808
  1612.  
  1613.  Files: CALC.LIB
  1614.  
  1615.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1616.          28613 River Glen Ct. #1
  1617.          Menifee, CA 92584-8987 USA
  1618.  
  1619.          (909) 679-3364
  1620.  
  1621.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1622.    See Also: TANR() SIN() COS() ATAN() COT()
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  TANR()
  1630.  To return the TANGENT of a radian.
  1631. ──────────────────────────────────────────────────────────────────────────────
  1632.  
  1633.  Syntax
  1634.  
  1635.       TANR( <nRadian> ) -> nTan
  1636.  
  1637.  Arguments
  1638.  
  1639.       <nRadian> is a numeric value representing a radian value.
  1640.  
  1641.  Returns
  1642.  
  1643.       TANR() returns the tangent value of <nRadian>.
  1644.  
  1645.  Description
  1646.  
  1647.       TANR() is a trigonometrical function that returns the tangent value of
  1648.       a radian.
  1649.  
  1650.       For radians, see TAN().
  1651.  
  1652.       Accuracy is to the twelfth decimal (i.e. .00000000001)
  1653.  
  1654.  Examples
  1655.  
  1656.       ? Str( TANR( 1), 12,  9)  // returns  1.557407725
  1657.       ? Str( TANR(-1), 12,  9)  // returns -1.557407725
  1658.  
  1659.  Files: CALC.LIB
  1660.  
  1661.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1662.          28613 River Glen Ct. #1
  1663.          Menifee, CA 92584-8987 USA
  1664.  
  1665.          (909) 679-3364
  1666.  
  1667.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1668.    See Also: TAN() SINR() COSR() ATANR() COTR()
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  ASIN()
  1676.  To return the ARCSINE in degrees of a sine value.
  1677. ──────────────────────────────────────────────────────────────────────────────
  1678.  
  1679.  Syntax
  1680.  
  1681.       ASIN( <nSin> ) -> nDegree
  1682.  
  1683.  Arguments
  1684.  
  1685.       <nSin> is a numeric value representing a sine value.
  1686.  
  1687.       NOTE: Since a parameter of greater than 1 result in a math overflow,
  1688.             this function returns 0 as a result instead of a math overflow.
  1689.  
  1690.  Returns
  1691.  
  1692.       ASIN() returns the arcsine value (reverse sine) in degrees of <nSin>.
  1693.  
  1694.  Description
  1695.  
  1696.       ASIN() is a trigonometrical function that returns the arcsine value
  1697.       in degrees of a sine value.
  1698.  
  1699.       For radians, see ASINR().
  1700.  
  1701.       Accuracy is to the twelfth decimal (i.e. .00000000001)
  1702.  
  1703.  Examples
  1704.  
  1705.       ? Str( ASIN(.707106781), 5,  2)  // returns 45.00
  1706.       ? Str( ASIN(.866025403), 5,  2)  // returns 60.00
  1707.  
  1708.  Files: CALC.LIB
  1709.  
  1710.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1711.          28613 River Glen Ct. #1
  1712.          Menifee, CA 92584-8987 USA
  1713.  
  1714.          (909) 679-3364
  1715.  
  1716.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1717.    See Also: ASINR() ACOS() ATAN() SIN() SEC()
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  ASINR()
  1725.  To return the ARCSINE in radians of a sine value.
  1726. ──────────────────────────────────────────────────────────────────────────────
  1727.  
  1728.  Syntax
  1729.  
  1730.       ASINR( <nSin> ) -> nRadian
  1731.  
  1732.  Arguments
  1733.  
  1734.       <nSin> is a numeric value representing a sine value.
  1735.  
  1736.       NOTE: Since a parameter of greater than 1 result in a math overflow,
  1737.             this function returns 0 as a result instead of a math overflow.
  1738.  
  1739.  Returns
  1740.  
  1741.       ASINR() returns the arcsine value (reverse sine) in radians of <nSin>.
  1742.  
  1743.  Description
  1744.  
  1745.       ASINR() is a trigonometrical function that returns the arcsine value
  1746.       in radians of a sine value.
  1747.  
  1748.       For degrees, see ASIN().
  1749.  
  1750.       Accuracy is to the twelfth decimal (i.e. .00000000001)
  1751.  
  1752.  Examples
  1753.  
  1754.       ? Str( ASINR(.707106781), 8,  6)  // returns 0.785398
  1755.       ? Str( ASINR(.866025403), 8,  6)  // returns 1.047198
  1756.  
  1757.  Files: CALC.LIB
  1758.  
  1759.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1760.          28613 River Glen Ct. #1
  1761.          Menifee, CA 92584-8987 USA
  1762.  
  1763.          (909) 679-3364
  1764.  
  1765.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1766.    See Also: ASIN() ACOSR() ATANR() SINR() SECR()
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  ACOS()
  1774.  To return the ARCCOSINE in degrees of a cosine value.
  1775. ──────────────────────────────────────────────────────────────────────────────
  1776.  
  1777.  Syntax
  1778.  
  1779.       ACOS( <nCos> ) -> nDegree
  1780.  
  1781.  Arguments
  1782.  
  1783.       <nCos> is a numeric value representing a cosine value.
  1784.  
  1785.       NOTE: Since a parameter of greater than 1 result in a math overflow,
  1786.             this function returns 0 as a result instead of a math overflow.
  1787.  
  1788.  Returns
  1789.  
  1790.       ACOS() returns the arccosine value (reverse cosine) in degrees of
  1791.       <nCos>.
  1792.  
  1793.  Description
  1794.  
  1795.       ACOS() is a trigonometrical function that returns the arccosine value
  1796.       in degrees of a cosine value.
  1797.  
  1798.       For radians, see ACOSR().
  1799.  
  1800.       Accuracy is to the twelfth decimal (i.e. .00000000001)
  1801.  
  1802.  Examples
  1803.  
  1804.       ? Str( ACOS(.707106781), 5,  2)  // returns 45.00
  1805.       ? Str( ACOS(.866025403), 5,  2)  // returns 30.00
  1806.  
  1807.  Files: CALC.LIB
  1808.  
  1809.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1810.          28613 River Glen Ct. #1
  1811.          Menifee, CA 92584-8987 USA
  1812.  
  1813.          (909) 679-3364
  1814.  
  1815.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1816.    See Also: ACOSR() ASIN() ATAN() COS() SEC()
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  ACOSR()
  1824.  To return the ARCCOSINE in radians of a cosine value.
  1825. ──────────────────────────────────────────────────────────────────────────────
  1826.  
  1827.  Syntax
  1828.  
  1829.       ACOSR( <nCos> ) -> nRadian
  1830.  
  1831.  Arguments
  1832.  
  1833.       <nCos> is a numeric value representing a cosine value.
  1834.  
  1835.       NOTE: Since a parameter of greater than 1 result in a math overflow,
  1836.             this function returns 0 as a result instead of a math overflow.
  1837.  
  1838.  Returns
  1839.  
  1840.       ACOSR() returns the arccosine value (reverse cosign) in radians of
  1841.       <nCos>.
  1842.  
  1843.  Description
  1844.  
  1845.       ACOSR() is a trigonometrical function that returns the arccosine value
  1846.       in radians of a cosine value.
  1847.  
  1848.       For degrees, see ACOS().
  1849.  
  1850.       Accuracy is to the twelfth decimal (i.e. .00000000001)
  1851.  
  1852.  Examples
  1853.  
  1854.       ? Str( ACOSR(.707106781), 8,  6)  // returns 0.785398
  1855.       ? Str( ACOSR(.866025403), 8,  6)  // returns 0.523599
  1856.  
  1857.  Files: CALC.LIB
  1858.  
  1859.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1860.          28613 River Glen Ct. #1
  1861.          Menifee, CA 92584-8987 USA
  1862.  
  1863.          (909) 679-3364
  1864.  
  1865.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1866.    See Also: ACOS() ASINR() ATANR() COS() SEC()
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  ATAN()
  1874.  To return the ARCTANGENT in degrees of a tangent value.
  1875. ──────────────────────────────────────────────────────────────────────────────
  1876.  
  1877.  Syntax
  1878.  
  1879.       ATAN( <nTan> ) -> nDegree
  1880.  
  1881.  Arguments
  1882.  
  1883.       <nTan> is a numeric value representing a tangent value.
  1884.  
  1885.       NOTE: Since a parameter of greater than 1 result in a math overflow,
  1886.             this function returns 0 as a result instead of a math overflow.
  1887.  
  1888.  Returns
  1889.  
  1890.       ATAN() returns the arctangent value (reverse tangent) in degrees of
  1891.       <nTan>.
  1892.  
  1893.  Description
  1894.  
  1895.       ATAN() is a trigonometrical function that returns the arctangent value
  1896.       in degrees of a tangent value.
  1897.  
  1898.       For radians, see ATANR().
  1899.  
  1900.       Accuracy is to the twelfth decimal (i.e. .00000000001)
  1901.  
  1902.  Examples
  1903.  
  1904.       ? Str( ATAN(.707106781), 5,  2)  // returns 35.26
  1905.       ? Str( ATAN(.866025403), 5,  2)  // returns 40.89
  1906.  
  1907.  Files: CALC.LIB
  1908.  
  1909.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1910.          28613 River Glen Ct. #1
  1911.          Menifee, CA 92584-8987 USA
  1912.  
  1913.          (909) 679-3364
  1914.  
  1915.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1916.    See Also: ATANR() ASIN() ACOS() TAN() SEC()
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  ATANR()
  1924.  To return the ARCTANGENT in radians of a tangent value.
  1925. ──────────────────────────────────────────────────────────────────────────────
  1926.  
  1927.  Syntax
  1928.  
  1929.       ATANR( <nTan> ) -> nRadian
  1930.  
  1931.  Arguments
  1932.  
  1933.       <nTan> is a numeric value representing a tangent value.
  1934.  
  1935.       NOTE: Since a parameter of greater than 1 result in a math overflow,
  1936.             this function returns 0 as a result instead of a math overflow.
  1937.  
  1938.  Returns
  1939.  
  1940.       ATANR() returns the arctangent value (reverse tangent) in radians of
  1941.       <nTan>.
  1942.  
  1943.  Description
  1944.  
  1945.       ATANR() is a trigonometrical function that returns the arctangent value
  1946.       in radians of a tangent value.
  1947.  
  1948.       For degrees, see ATAN().
  1949.  
  1950.       Accuracy is to the twelfth decimal (i.e. .00000000001)
  1951.  
  1952.  Examples
  1953.  
  1954.       ? Str( ATANR(.707106781), 8,  6)  // returns 0.615480
  1955.       ? Str( ATANR(.866025403), 8,  6)  // returns 0.713724
  1956.  
  1957.  Files: CALC.LIB
  1958.  
  1959.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  1960.          28613 River Glen Ct. #1
  1961.          Menifee, CA 92584-8987 USA
  1962.  
  1963.          (909) 679-3364
  1964.  
  1965.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  1966.    See Also: ATAN() ASINR() ACOSR() TANR() SECR()
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  PI()
  1974.  To return the value of PI.
  1975. ──────────────────────────────────────────────────────────────────────────────
  1976.  
  1977.  Syntax
  1978.  
  1979.       PI() -> 3.141592653589792
  1980.  
  1981.  Arguments
  1982.  
  1983.       none
  1984.  
  1985.  Returns
  1986.  
  1987.       PI() returns the value of PI (3.141592653589792)
  1988.  
  1989.  Description
  1990.  
  1991.       PI() returns the value of PI which is used to convert from
  1992.       degrees to radians and back.
  1993.  
  1994.       Accuracy is to the fifteenth decimal (i.e. .00000000000001)
  1995.  
  1996.  Examples
  1997.  
  1998.       ? Str( PI(), 17,15)  // returns 3.141592653589792
  1999.  
  2000.  Files: CALC.LIB
  2001.  
  2002.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  2003.          28613 River Glen Ct. #1
  2004.          Menifee, CA 92584-8987 USA
  2005.  
  2006.          (909) 679-3364
  2007.  
  2008.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  2009.    See Also:
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  FACTORIAL()
  2017.  To return the value of a factorial.
  2018. ──────────────────────────────────────────────────────────────────────────────
  2019.  
  2020.  Syntax
  2021.  
  2022.       FACTORIAL(<nInteger>) -> nFactorial
  2023.  
  2024.  Arguments
  2025.  
  2026.       <nInteger> is a numeric integer that is used to compute a factorial.
  2027.  
  2028.  Returns
  2029.  
  2030.       FACTORIAL() returns the value of a factorial
  2031.  
  2032.  Description
  2033.  
  2034.       A factorial value is the result of multiplying an integer by every
  2035.       integer below it.
  2036.  
  2037.       For example, the factorial of 6 is equal to (6*5*4*3*2*1 = 720).
  2038.  
  2039.  Examples
  2040.  
  2041.       ? Str( FACTORIAL(6), 5,0)  // returns   720
  2042.  
  2043.  Files: CALC.LIB
  2044.  
  2045.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  2046.          28613 River Glen Ct. #1
  2047.          Menifee, CA 92584-8987 USA
  2048.  
  2049.          (909) 679-3364
  2050.  
  2051.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  2052.    See Also:
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  INVLOG()
  2060.  To return the value of an inverse logarithm.
  2061. ──────────────────────────────────────────────────────────────────────────────
  2062.  
  2063.  Syntax
  2064.  
  2065.       INVLOG(<nLog>) -> nValue
  2066.  
  2067.  Arguments
  2068.  
  2069.       <nLog> is a logarithmic value.
  2070.  
  2071.  Returns
  2072.  
  2073.       INVLOG() returns the value of an inverse logarithm.
  2074.  
  2075.  Description
  2076.  
  2077.       INVLOG() returns the value of an inverse logarithm.
  2078.  
  2079.  Examples
  2080.  
  2081.       ? Str( INVLOG(2), 5,0)  // returns   100
  2082.  
  2083.       Accuracy is beyond the twelfth decimal (i.e. .00000000001)
  2084.  
  2085.  Files: CALC.LIB
  2086.  
  2087.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  2088.          28613 River Glen Ct. #1
  2089.          Menifee, CA 92584-8987 USA
  2090.  
  2091.          (909) 679-3364
  2092.  
  2093.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  2094.    See Also:
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  DTOR()
  2102.  To convert degrees to radians.
  2103. ──────────────────────────────────────────────────────────────────────────────
  2104.  
  2105.  Syntax
  2106.  
  2107.       DTOR(<nDegrees>) -> nRadians
  2108.  
  2109.  Arguments
  2110.  
  2111.       <nDegrees> is a numeric value representing degrees.
  2112.  
  2113.  Returns
  2114.  
  2115.       DTOR() returns the radian measure of nDegrees.
  2116.  
  2117.  Description
  2118.  
  2119.       DTOR() returns the radian measure of nDegrees.
  2120.  
  2121.  Examples
  2122.  
  2123.       ? Str( DTOR(180), 17, 15)  // returns 3.141592653589792
  2124.  
  2125.  Files: CALC.LIB
  2126.  
  2127.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  2128.          28613 River Glen Ct. #1
  2129.          Menifee, CA 92584-8987 USA
  2130.  
  2131.          (909) 679-3364
  2132.  
  2133.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  2134.    See Also:
  2135.  
  2136.  
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  RTOD()
  2142.  To convert radians to degrees.
  2143. ──────────────────────────────────────────────────────────────────────────────
  2144.  
  2145.  Syntax
  2146.  
  2147.       RTOD(<nRadians>) -> nDegrees
  2148.  
  2149.  Arguments
  2150.  
  2151.       <nRadians> is a numeric value representing radians.
  2152.  
  2153.  Returns
  2154.  
  2155.       RTOD() returns the degree measure of nRadians.
  2156.  
  2157.  Description
  2158.  
  2159.       RTOD() returns the degree measure of nRadians.
  2160.  
  2161.  Examples
  2162.  
  2163.       ? Str( RTOD(PI()), 3, 0)  // returns 180
  2164.  
  2165.  Files: CALC.LIB
  2166.  
  2167.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  2168.          28613 River Glen Ct. #1
  2169.          Menifee, CA 92584-8987 USA
  2170.  
  2171.          (909) 679-3364
  2172.  
  2173.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  2174.    See Also:
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  SIGN()
  2182.  To return the sign of a number.
  2183. ──────────────────────────────────────────────────────────────────────────────
  2184.  
  2185.  Syntax
  2186.  
  2187.       SIGN(<nValue>) -> nSign
  2188.  
  2189.  Arguments
  2190.  
  2191.       <nValue> is a numeric value.
  2192.  
  2193.  Returns
  2194.  
  2195.       SIGN() returns the sign of a value.
  2196.  
  2197.       For a positive value, SIGN() returns +1.
  2198.       For a negative value, SIGN() returns -1.
  2199.       For zero, SIGN() returns 0.
  2200.  
  2201.  Description
  2202.  
  2203.       SIGN() is used to determine if a number is positive, negative, or
  2204.       neutral (zero).
  2205.  
  2206.  Examples
  2207.  
  2208.       ? Str( SIGN( 5), 2, 0)  // returns  1
  2209.       ? Str( SIGN(-5), 2, 0)  // returns -1
  2210.       ? Str( SIGN( 0), 2, 0)  // returns  0
  2211.  
  2212.  Files: CALC.LIB
  2213.  
  2214.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  2215.          28613 River Glen Ct. #1
  2216.          Menifee, CA 92584-8987 USA
  2217.  
  2218.          (909) 679-3364
  2219.  
  2220.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  2221.    See Also:
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  CSC()
  2229.  To return the COSECANT of a degree.
  2230. ──────────────────────────────────────────────────────────────────────────────
  2231.  
  2232.  Syntax
  2233.  
  2234.       CSC(<nValue>) -> nCosecant
  2235.  
  2236.  Arguments
  2237.  
  2238.       <nValue> is a numeric degree.
  2239.  
  2240.  Returns
  2241.  
  2242.       CSC() returns the cosecant of a degree.
  2243.  
  2244.  Description
  2245.  
  2246.       CSC() returns the cosecant of a degree.
  2247.  
  2248.  Examples
  2249.  
  2250.       ? Str( CSC(30), 8, 5)  // returns  2.00000
  2251.  
  2252.  Files: CALC.LIB
  2253.  
  2254.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  2255.          28613 River Glen Ct. #1
  2256.          Menifee, CA 92584-8987 USA
  2257.  
  2258.          (909) 679-3364
  2259.  
  2260.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  2261.    See Also:
  2262.  
  2263.  
  2264.  
  2265.  
  2266.  
  2267.  
  2268.  CSCR()
  2269.  To return the COSECANT of a radian.
  2270. ──────────────────────────────────────────────────────────────────────────────
  2271.  
  2272.  Syntax
  2273.  
  2274.       CSCR(<nValue>) -> nCosecant
  2275.  
  2276.  Arguments
  2277.  
  2278.       <nValue> is a numeric radian.
  2279.  
  2280.  Returns
  2281.  
  2282.       CSCR() returns the cosecant of a radian.
  2283.  
  2284.  Description
  2285.  
  2286.       CSCR() returns the cosecant of a radian.
  2287.  
  2288.  Examples
  2289.  
  2290.       ? Str( CSCR(.5236), 8, 5)  // returns  2.00000
  2291.  
  2292.  Files: CALC.LIB
  2293.  
  2294.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  2295.          28613 River Glen Ct. #1
  2296.          Menifee, CA 92584-8987 USA
  2297.  
  2298.          (909) 679-3364
  2299.  
  2300.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  2301.    See Also:
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  SEC()
  2309.  To return the SECANT of a degree.
  2310. ──────────────────────────────────────────────────────────────────────────────
  2311.  
  2312.  Syntax
  2313.  
  2314.       SEC(<nValue>) -> nSecant
  2315.  
  2316.  Arguments
  2317.  
  2318.       <nValue> is a numeric degree.
  2319.  
  2320.  Returns
  2321.  
  2322.       SEC() returns the secant of a degree.
  2323.  
  2324.  Description
  2325.  
  2326.       SEC() returns the secant of a degree.
  2327.  
  2328.  Examples
  2329.  
  2330.       ? Str( SEC(30), 8, 5)  // returns  1.15470
  2331.  
  2332.  Files: CALC.LIB
  2333.  
  2334.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  2335.          28613 River Glen Ct. #1
  2336.          Menifee, CA 92584-8987 USA
  2337.  
  2338.          (909) 679-3364
  2339.  
  2340.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  2341.    See Also:
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  SECR()
  2349.  To return the SECANT of a radian.
  2350. ──────────────────────────────────────────────────────────────────────────────
  2351.  
  2352.  Syntax
  2353.  
  2354.       SECR(<nValue>) -> nSecant
  2355.  
  2356.  Arguments
  2357.  
  2358.       <nValue> is a numeric radian.
  2359.  
  2360.  Returns
  2361.  
  2362.       SECR() returns the secant of a radian.
  2363.  
  2364.  Description
  2365.  
  2366.       SECR() returns the secant of a radian.
  2367.  
  2368.  Examples
  2369.  
  2370.       ? Str( SECR(.5236), 8, 5)  // returns  1.15470
  2371.  
  2372.  Files: CALC.LIB
  2373.  
  2374.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  2375.          28613 River Glen Ct. #1
  2376.          Menifee, CA 92584-8987 USA
  2377.  
  2378.          (909) 679-3364
  2379.  
  2380.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  2381.    See Also:
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.  
  2388.  COT()
  2389.  To return the COTANGENT of a degree.
  2390. ──────────────────────────────────────────────────────────────────────────────
  2391.  
  2392.  Syntax
  2393.  
  2394.       COT(<nValue>) -> nCotangent
  2395.  
  2396.  Arguments
  2397.  
  2398.       <nValue> is a numeric degree.
  2399.  
  2400.  Returns
  2401.  
  2402.       COT() returns the cotangent of a degree.
  2403.  
  2404.  Description
  2405.  
  2406.       COT() returns the cotangent of a degree.
  2407.  
  2408.  Examples
  2409.  
  2410.       ? Str( COT(30), 8, 5)  // returns  1.73205
  2411.  
  2412.  Files: CALC.LIB
  2413.  
  2414.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  2415.          28613 River Glen Ct. #1
  2416.          Menifee, CA 92584-8987 USA
  2417.  
  2418.          (909) 679-3364
  2419.  
  2420.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  2421.    See Also:
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  COTR()
  2429.  To return the COTANGENT of a radian.
  2430. ──────────────────────────────────────────────────────────────────────────────
  2431.  
  2432.  Syntax
  2433.  
  2434.       COTR(<nValue>) -> nCotangent
  2435.  
  2436.  Arguments
  2437.  
  2438.       <nValue> is a numeric radian.
  2439.  
  2440.  Returns
  2441.  
  2442.       COTR() returns the cotangent of a radian.
  2443.  
  2444.  Description
  2445.  
  2446.       COTR() returns the cotangent of a radian.
  2447.  
  2448.  Examples
  2449.  
  2450.       ? Str( COTR(.5236), 8, 5)  // returns  1.73205
  2451.  
  2452.  Files: CALC.LIB
  2453.  
  2454.  Author: Touchstone Business Creations          CompuServe ID: 73670,2561
  2455.          28613 River Glen Ct. #1
  2456.          Menifee, CA 92584-8987 USA
  2457.  
  2458.          (909) 679-3364
  2459.  
  2460.  Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations
  2461.    See Also:
  2462.  
  2463.  
  2464.  Programming
  2465. ──────────────────────────────────────────────────────────────────────────────
  2466.  
  2467.  
  2468.   Easiest Use          (SET KEY ... TO CALCULATOR)
  2469.  
  2470.       #include "inkey.ch"
  2471.  
  2472.       Function Test()
  2473.  
  2474.          CALCREG(00000)                 //insert your registration number
  2475.          SET KEY K_ALT_O TO CALCULATOR  //this is all you need
  2476.  
  2477.          nValue := 0
  2478.          @ 5,5 Get nValue
  2479.  
  2480.          Read               //while in read, press ALT_O for the calculator
  2481.  
  2482.       Return NIL
  2483.  
  2484.       First, the above example sets your registration number (once you
  2485.       receive it from Touchstone Business Creations).
  2486.  
  2487.       Then, it sets the key K_ALT_O to call the CALCULATOR function
  2488.       when it is in a wait state (i.e. READ, MENU TO, MEMOEDIT, etc).
  2489.  
  2490.       Once you are in any wait state (until you choose to turn it off),
  2491.       pressing ALT_O will call up the calculator function.
  2492.  
  2493.       If you are on a numeric value at the time, it will become the
  2494.       display in the calculator.  When finished calculating, you may
  2495.       press CTRL_ENTER and transfer or paste the value back into
  2496.       where you were editing.
  2497.  
  2498.  
  2499.   Adding Keys          ( SetKey(... , {||...}) )
  2500.  
  2501.       Adding keys are useful for any type of specific calculations.
  2502.  
  2503.       nTax := 1.0775
  2504.       SetKey(K_ALT_T, {|cProc,nVer,cVar,nVal| ;
  2505.                       If(c1="CALCULATOR",nVal*nTax,NIL)})
  2506.  
  2507.       For example, the above two lines can be added anywhere in the code
  2508.       prior to using the calculator. While using it, you can press
  2509.       ALT_T and the current calculator value will be multiplied by (nTax)
  2510.       giving you the price with tax immediately in the display as your
  2511.       current calculated value.
  2512.  
  2513.  
  2514.       You can also be specific about the variables you use keys upon:
  2515.  
  2516.  
  2517.  
  2518.  
  2519.  
  2520.       nTax := 1.0775
  2521.       SetKey(K_ALT_T, {|cProc,nVer,cVar,nVal| ;
  2522.                       If(c1="CALCULATOR" .and. Upper(cVar)="SUBTOTAL",;
  2523.                       nVal*nTax,NIL)})
  2524.  
  2525.       For example, the above two lines will verify (1) that we are
  2526.       operating from the calculator, and (2) the variable that the
  2527.       calculator was called from was named "SUBTOTAL".
  2528.       Once those are true, the calculator value will be multiplied
  2529.       by (nTax) giving you the price with tax.
  2530.  
  2531.       SEE "CALCULATOR()" information for more.
  2532.  
  2533. ──────────────────────────────────────────────────────────────────────────────
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  Linking CALC.LIB
  2543. ──────────────────────────────────────────────────────────────────────────────
  2544.  
  2545.  
  2546.   Library
  2547.  
  2548.       CALC.LIB   -  This is the library that contains all the calculator
  2549.                     and supporting functions.
  2550.                     It can be *COMPLETELY* overlaid.
  2551.  
  2552.                     When prelinking, use the REFER names of "CALC20",
  2553.                     "TRIG" and "NUMLOCK".
  2554.  
  2555.  
  2556.   Linking (Non-overlaid use)
  2557.  
  2558.       Microsoft:
  2559.  
  2560.           LINK <yourObj>, <yourExe>, <yourMap>, <yourLib> + CALC
  2561.  
  2562.       Borland:
  2563.  
  2564.           TLINK <yourObj>, <yourExe>, <yourMap>, <yourLib> + CALC
  2565.  
  2566.       Blinker:
  2567.  
  2568.           Blinker FI <yourObj> LIB CALC
  2569.  
  2570.       Pocket Soft:
  2571.  
  2572.           RTLink FI <yourObj> LIB CALC
  2573.  
  2574.  
  2575.   Linking (Overlaid use)
  2576.  
  2577.       When overlaying with Blinker,
  2578.       the following sample script
  2579.       files can be used:
  2580.  
  2581.  
  2582.       Clipper 5.x:
  2583.  
  2584.           FILE <yourObj>
  2585.  
  2586.           BEGIN
  2587.  
  2588.               FILE <yourFiles>
  2589.               FILE <mousefile>   #see next section for choice of mouse files
  2590.               ALLOCATE CALC
  2591.  
  2592.           END
  2593.           LIB CLIPPER, TERMINAL, DBFNTX
  2594.  
  2595.  
  2596.  
  2597.  
  2598.  
  2599.  
  2600. ──────────────────────────────────────────────────────────────────────────────
  2601.  
  2602.  
  2603.  
  2604.  Using FUNMOUSE, FUNMOUSX, DCLMOUSE, NANMOUSE or NOMOUSE
  2605. ──────────────────────────────────────────────────────────────────────────────
  2606.  
  2607.   Overview
  2608.  
  2609.     In order to use a mouse driver, you must have a library that support
  2610.     mouse control.  The interfaces that are supplied with CALC 2.1 are for
  2611.     Funcky, dCLIP, and NANFOR.
  2612.  
  2613.     By default, NOMOUSE is linked into your system (through CALC.LIB),
  2614.     defining "no mouse support" for the calculator.
  2615.  
  2616.     If you choose to use a mouse driver, use one of the following:
  2617.  
  2618.   Funcky II
  2619.  
  2620.     When using Funcky II mouse system, you currently have two types of
  2621.     mouse support: one for protected mode (like ExoSpace or Blinker 3),
  2622.     and one without protected mode.
  2623.  
  2624.     The difference between protected mode (FUNMOUSX.OBJ) and non-protected
  2625.     mode (FUNMOUSE.OBJ) is support for the graphical cursor.  As this
  2626.     piece of documentation is being written, there is no protected mode
  2627.     support for Funcky II's graphical cursor.  This may change.  If it
  2628.     does, simply use FUNMOUSE instead of FUNMOUSX in your link script.
  2629.  
  2630.     For Protected Mode Funcky:          For Non-Protected Mode Funcky:
  2631.  
  2632.     fi <your.obj>                       fi <your.obj>
  2633.     BEGINAREA                           BEGINAREA
  2634.  
  2635.        fi FUNMOUSX            <=====>      fi FUNMOUSE
  2636.        allocate CALC                       allocate CALC
  2637.  
  2638.     ENDAREA                             ENDAREA
  2639.     @funcky        #your funcky libs    @funcky        #your funcky libs
  2640.     lib CLIPPER, TERMINAL, ...          lib CLIPPER, TERMINAL, ...
  2641.  
  2642.     Source code is included for the Funcky interface in FUNMOUSE.PRG
  2643.  
  2644.  
  2645.  
  2646.   dCLIP
  2647.  
  2648.     When using dCLIP mouse system, simply link in the DCLMOUSE.OBJ file
  2649.     prior to the library CALC:
  2650.  
  2651.     For dCLIP:
  2652.  
  2653.     fi <your.obj>
  2654.     BEGINAREA
  2655.  
  2656.        fi DCLMOUSE
  2657.        allocate CALC
  2658.  
  2659.     ENDAREA
  2660.     @dclip               #your dclip modules, files and libraries
  2661.     lib CLIPPER, TERMINAL, ...
  2662.  
  2663.   NANFOR
  2664.  
  2665.     When using NANFOR mouse system, simply link in the NANMOUSE.OBJ file
  2666.     prior to the library CALC:
  2667.  
  2668.     For dCLIP:
  2669.  
  2670.     fi <your.obj>
  2671.     BEGINAREA
  2672.  
  2673.        fi NANMOUSE
  2674.        allocate CALC
  2675.  
  2676.     ENDAREA
  2677.     @nanfor              #your nanfor library
  2678.     lib CLIPPER, TERMINAL, ...
  2679.  
  2680.   NOMOUSE
  2681.  
  2682.     NOMOUSE.OBJ is the default of the CALC.LIB and does not need to be
  2683.     explicitly included.  However, for posterity, here it is:
  2684.  
  2685.     fi <your.obj>
  2686.     BEGINAREA
  2687.  
  2688.        fi NOMOUSE
  2689.        allocate CALC
  2690.  
  2691.     ENDAREA
  2692.     lib CLIPPER, TERMINAL, ...
  2693.