home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / popcalc7.zip / POPCALC7.DOC next >
Text File  |  1990-12-19  |  13KB  |  247 lines

  1.  
  2.                       ************************************
  3.                       *           < PopCalc7 >           *
  4.                       *  Pop-up Calculator for dBase IV  *
  5.                       *            Version 1.1           *
  6.                       ************************************
  7.  
  8.                                December 19, 1990
  9.  
  10.  
  11.  
  12.                                     PopCalc7
  13.                                Pop-Up Calculator
  14.                                       for
  15.                              dBASE IV / Version 1.1
  16.  
  17.     I don't know about your desk, but more often than not, I barely have enough
  18. room for my coffee cup, much less (ugh!) a calculator.  A sizable portion of
  19. the available real estate in front of me has been occupied by PC components for
  20. some time now, and with it, a number of TSRs that tend to make life easier.  As
  21. much as I enjoyed version 1.0 (YES! I really got a kick out of it - bugs and
  22. all!), I found that TSRs and dBASE were not to be.  Memory was at a premium,
  23. and so was my desk space; and I can't live without at least a rudimentary
  24. calculator at hand.  Well, as the saying goes:  "Necessity is the Mother of
  25. Invention" (no offense, Frank).  With dBASE IV's powerful programming
  26. environment and windowing capabilities, I thought "why not?".  The result was
  27. PopCalc.
  28.  
  29.     PopCalc7 operates for all intents and purposes the same as most other
  30. multi-function calculators do.  You can store, retrieve, and manipulate a value
  31. held in "memory", and you can even view (and print) a tape filled with your
  32. calculating activity.  The ENTER key is the same as the "=" key.  To
  33. exponentiate a number, press the carat "^", followed by a number.  A paste
  34. function (store a number to a key) is provided along with an immediate paste
  35. routine.
  36.  
  37.     Now that dBASE IV version 1.1 has been released, accompanied by both
  38. additions to the language and its removal of previously imposed ON KEY and
  39. UDF() restrictions, I have added a few new features and routines to PopCalc. 
  40. For continuity's sake, this version is known as PopCalc7. The new features
  41. implemented in PopCalc7 include movable and exploding windows, assorted
  42. shadowing techniques, an immediate paste feature, a user-implemented,
  43. on-the-fly re-configuration screen, and the ability to execute from any
  44. application with little or no modification. 
  45.  
  46.     All input is now via INKEY(0) exclusively, thereby eliminating any problems
  47. with nested reads when in a multi-page format.  Also included is an on-line
  48. help facility <F1> and a UDF() which cleans up the paste number (now stripped
  49. of any leading/trailing blanks, zeros, and decimal points - no more beeps when
  50. pasting an integer to an integer memvar). PopCalc7 now utilizes a memory file
  51. and one public memvar <gl_PopCalc> for retaining its status.  The calculator
  52. will save to and restore from the memory file as long as the public memvar
  53. exists, and releases all memory used (except the one public memvar) between
  54. calls to PopCalc7, thereby giving it the appearance of a TSR.  The memory
  55. variables which will be saved to PopCalc7.MEM are designated as
  56. m<type>_<name>.  ie:  
  57.  
  58.                          ml_<name> = logical memvars
  59.                          mn_<name> = numerical memvars
  60.                          mc_<name> = character memvars
  61.                          ma_<name> = array memvars
  62.  
  63. Prior to terminating, this command is issued:
  64.  
  65.                         SAVE TO PopCalc7 ALL LIKE m?_* 
  66.  
  67.               
  68.     For you conservative typists (I prefer one key press over many), I suggest
  69. assigning, preferably from within your CONFIG.DB file, a function key to run
  70. PopCalc7 from the dot prompt:    
  71.  
  72.                       SET FUNCTION <nn> TO "DO PopCalc7;" 
  73.        
  74.     To execute it from within a program, one may enable it by a "hot-key"
  75. command such as: 
  76.          
  77.                          ON KEY LABEL ALT-C DO PopCalc7
  78.  
  79.  
  80.      Pressing "R" allows one to re-configure PopCalc7,  allowing the user to
  81. change four "configuration" memvars from within PopCalc7.
  82.  
  83.                    ml_Shadow  = .t. for shadow usage
  84.                    ml_Explode = .t. for exploding windows
  85.                    ml_Move    = .t. enables moving windows.
  86.                    mn_TapeSiz =  Used to declare the tape array.
  87.  
  88.     The logical memvars can be toggled by pressing the space bar, "Y", or "N",
  89. and the tape size array can be adjusted by pressing + or -.   The window
  90. appears and acts as though it were painted by:
  91.  
  92.                      @..GET..READ...PICTURE "!M Yes, No " 
  93.  
  94.     However, it is done entirely with ARRAY, DO WHILE, INKEY(0), and DO CASE
  95. statements.  Procedure PC_Param calls Procedure ParamNum to increment/decrement
  96. the user key press for tape size.  Additionally, if F1 is pressed, it will call
  97. Procedure CalcHelp.
  98.      
  99.     Pressing "T" enables the tape functions.  Control branches to procedure
  100. TapeDisp, where the user can view, print, or clear the tape.  The window
  101. PopTape will be activated and can display up to 10 lines at a time.  If the
  102. tape consists of more than 10 lines, the last 10 items will be displayed.  The
  103. relative position of the current tape screen is indicated by "More" on either
  104. or both of the upper and lower boundaries on the activated tape display.  The
  105. user may browse through all tape entries by pressing the up or down arrows for
  106. single line scrolling, <PageUp> or <PageDown> to scroll 10 lines at a time,
  107. <Home> for the beginning, <End> for the end of tape, and F1 for help.  
  108.   
  109.     To print the tape, the user may press the "P" key from within the tape
  110. window, and a complete tape listing will be routed to the current printer.  The
  111. tape can also be cleared by pressing the "C" key from within the tape window.
  112. Clearing the tape is accomplished by executing procedure TapeInit.
  113.  
  114.     A press of the "P" key from within the calculator executes procedure
  115. PasteVal, allowing one to "paste" the answer to a function key.  The user will
  116. then be prompted to enter the function key assignment.  The available
  117. assignments are any valid function key from the following table:
  118.  
  119.                                   F2 thru F10
  120.                             Shift-F1 thru Shift-F9
  121.                              Ctrl-F1 thru Ctrl-F10
  122.     
  123.     PopCalc7 will then assign the value held in ANSWER to the key assignment.
  124. PopCalc7 issues the command: 
  125.  
  126.             SET <function_key_assignment> TO <value_held_in_ANSWER>
  127.  
  128.          NOTE: When using the paste function within programs, it 
  129.                is a good idea to let your users know which func-
  130.                tion keys are available for use with the paste 
  131.                function. In order for the paste function to work, 
  132.                the program MUST NOT have previously assigned ON 
  133.                KEY LABEL <your_function_paste_key> <command>.
  134.      
  135.  
  136.     Pressing "E" erases the current entry, while "C" clears entry, operator,
  137. and operand.  The OTHERWISE clause is instigated as a catch-all, and resets the
  138. only critical memvar to it's previous value.
  139.  
  140.  
  141.                   *** WHY THE DIFFERENT SHADOWING METHODS? ***
  142.  
  143.     If a window is to be moved, its shadow should be moved also.  However,
  144. dBASE IV does not directly offer a shadowed window.  A transparant shadow can
  145. be created by @..FILL TO..COLOR W/N.  An opaque shadow can take the form of a
  146. second window. Both of these methods require their screen co-ordinates to be an
  147. offset of the window for which they provide the shadow. 
  148.  
  149.     Consideration must be given to the screen's status when using shadows. With
  150. a transparent shadow (FILL TO) the screen must first be activated. To
  151. interactively move a window, issue a MOVE WINDOW command. However, there is a
  152. screen refresh between the moves, and when using a trans- parent shadow, the
  153. shadow is lost.  One can program around this annoying behavior by merely
  154. activating the screen after the move window, issue a couple of FILL TOs to
  155. provide a two sided shadow, and then ACTIVATE the moved WINDOW. This way, the
  156. contents of the window are saved (never had to deactivate the window), the old
  157. shadow has disappeared, and a new shadow is created. Using this method allows
  158. the characters under the shadow to be viewed, however, it requires extensive
  159. programming to achieve transparent shadows when more than one window is veiwed
  160. and all are subject to movement.  This can really slow down an application when
  161. one is deeply nested, and when operating slowly, can cause an annoying blink of
  162. the shaded areas. 
  163.  
  164.     An easy way of moving windows with shadows is to use the opaque variety (a
  165. window as a shadow) and issue the MOVE WINDOW command first to the shadow
  166. window, and then to the primary window.  The commands are simple and the motion
  167. is relatively smooth.  Procedure Move_Win illustrates this.
  168.  
  169.     If one disables window movement for PopCalc7, the shadows, if enabled, will
  170. be transparent; otherwise, opaque.
  171.      
  172.                  *** NAVIGATIONAL KEYS AND THEIR RELATIONS ***
  173.  
  174.     Movement of the calculator or tape window is accomplished by pressing the
  175. arrow keys, page, or tab keys, or a Ctrl-combination of those keys.  The
  176. calculator and paste windows are moved, as one would expect, quite naturally
  177. via the arrow keys.  However, the tape window uses many of the same positioning
  178. keys for tape positioning purposes.  In order to accomodate both window
  179. movement and tape positioning movement, a few "tricks" had to be implemented. 
  180. The following table illustrates the positioning/navigating key usage: 
  181.  
  182.  
  183.                                  WINDOW              SCROLL ACTION
  184.                         ------------------------   ---------------
  185.                         Paste &                       Tape
  186.             Key Press    Calculator      Tape          Display
  187.          ------------    ----------   -----------   ---------------
  188.             UpArrow         Up            n/a         Up One Line
  189.             DnArrow        Down           n/a        Down One Line
  190.          Ctrl-RtArrow       Up            Up               n/a
  191.          Ctrl-LtArrow      Down          Down             n/a
  192.             LtArrow        Left          Left             n/a
  193.             RtArrow        Right         Right            n/a
  194.                Tab        Far Right     Far Right        n/a
  195.                End        Far Right        n/a         End of Tape
  196.             Shift-Tab    Far Left      Far Left         n/a
  197.                Home       Far Left         n/a         Top of Tape
  198.                PgUp          Top           n/a        Back 10 Lines
  199.                PgDn         Bottom         n/a        Down 10 Lines
  200.             Ctrl-PgUp     Upper Right   Upper Right      n/a
  201.             Ctrl-PgDn     Lower Right   Lower Right      n/a
  202.             Ctrl-Home     Upper Left    Upper Left       n/a
  203.             Ctrl-End      Lower Left    Lower Left       n/a
  204.          ------------    -----------   -----------   ---------------    
  205.  
  206.                                   Also of Note
  207.                                   ************
  208.      Users may wish to modify the color settings, as this example has been hard
  209. coded for color monitors.   The default display accuracy is set to four decimal
  210. places (0.0000);  the internal accuracy is whatever the default happens to be
  211. prior to executing PopCalc7. 
  212.  
  213.  
  214.                                                     Best wishes,
  215.  
  216.                                                     Richard H. Price 
  217.                                                     dATAMAX, Inc.
  218.                                                     324 Kingswood Drive
  219.                                                     El Paso, TX  79932
  220.                                                     (915) 581-7572
  221.                                                     ATBBS: HAMMETT
  222.                                                     CIS:   71157,762   
  223.  
  224.  
  225.  
  226.  
  227. ********************************************************************************
  228.  
  229.  
  230.                                *****************
  231.                                **  DISCLAMER  **
  232.                                *****************
  233.  
  234.               This software is provided "AS IS" and by using this 
  235.               software, you agree that Richard H. Price will not 
  236.               be held liable for any reason for any cost you may 
  237.               incur, whether in the present or the future.
  238.  
  239.  
  240.           ***********************************************************
  241.           * ps: For those appreciative (guilt ridden) <g> souls,    *
  242.           * a $$$ donation would surely make my wife feel better    *
  243.           * about all the time I've spent on this instead of other, *
  244.           * more lucrative ventures!                                *
  245.           ***********************************************************
  246.  
  247.