[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Programming
------------------------------------------------------------------------------


  Easiest Use          (SET KEY ... TO CALCULATOR)

      #include "inkey.ch"

      Function Test()

         CALCREG(00000)                 //insert your registration number
         SET KEY K_ALT_O TO CALCULATOR  //this is all you need

         nValue := 0
         @ 5,5 Get nValue

         Read               //while in read, press ALT_O for the calculator

      Return NIL

      First, the above example sets your registration number (once you
      receive it from Touchstone Business Creations).

      Then, it sets the key K_ALT_O to call the CALCULATOR function
      when it is in a wait state (i.e. READ, MENU TO, MEMOEDIT, etc).

      Once you are in any wait state (until you choose to turn it off),
      pressing ALT_O will call up the calculator function.

      If you are on a numeric value at the time, it will become the
      display in the calculator.  When finished calculating, you may
      press CTRL_ENTER and transfer or paste the value back into
      where you were editing.


  Adding Keys          ( SetKey(... , {||...}) )

      Adding keys are useful for any type of specific calculations.

      nTax := 1.0775
      SetKey(K_ALT_T, {|cProc,nVer,cVar,nVal| ;
                      If(c1="CALCULATOR",nVal*nTax,NIL)})

      For example, the above two lines can be added anywhere in the code
      prior to using the calculator. While using it, you can press
      ALT_T and the current calculator value will be multiplied by (nTax)
      giving you the price with tax immediately in the display as your
      current calculated value.


      You can also be specific about the variables you use keys upon:

      nTax := 1.0775
      SetKey(K_ALT_T, {|cProc,nVer,cVar,nVal| ;
                      If(c1="CALCULATOR" .and. Upper(cVar)="SUBTOTAL",;
                      nVal*nTax,NIL)})

      For example, the above two lines will verify (1) that we are
      operating from the calculator, and (2) the variable that the
      calculator was called from was named "SUBTOTAL".
      Once those are true, the calculator value will be multiplied
      by (nTax) giving you the price with tax.

      SEE "CALCULATOR()" information for more.

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



This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson