Start of README v1.1

MC101 calculator


MC101 was developed by McKay Software Services Ltd www.mckaysoftware.ie

This describes the purpose and components of MC101 and how to download, install, and use the MC101 program.

MC101 is a calculator program for AS400/ ISERIES. It emulates a multi-function and multi-memory calculator.

    CONTENTS

  1. OPERATION
  2. FUNCTIONS
  3. FEATURES
  4. COMMANDS
  5. COMMAND KEYS
  6. DISPLAY
  7. To run MC101
  8. SAVEFILE
  9. SHIPPING LIST
  10. Change Log

  1. OPERATION
  2. A number or command is keyed on a line and ENTER is pressed. The number is preceded by an arithmetic operator + - * /. If the arithmetic operator is omitted, + is assumed. A negative number is entered by keying a minus sign after the number. The result is applied to the answer. A visible subtotal is updated after each line is entered. The entered number lines are rolled up. In this way, the numbers are always available to view.
    Each line is given its own numeric label, which increments automatically. The user may change this to an alphanumeric label.
    ===>CONTENTS

  3. FUNCTIONS
  4. The functions provided are ...
    Arithmetic
    Percent
    Factorial
    Nth Power
    Nth Root
    Absolute
    Random
    + - * /
    %
    !
    **
    //
    AB
    RAND
    • Arithmetic + - * /
    • 12, + 5, -25, /123, *754
      The arithmetic operator may be used in front of any other function, except AB.
      The number range is 20,5 for positive numbers and 19,5 for negative numbers - i.e. 15 (or 14) digits to the left of the decimal point and 5 to the right.
    • Percent
    • 10%, *25%
      A negative number is converted to positive prior to the operation..
    • Factorial
    • 5!
      A negative number is converted to positive before the operation.
      Only the integer portion is used; any mantissa is ignored.
      The number range is 1 to 17.
    • Nth Power
    • **, **3, 5**, 4**5
      If no base (number to the left of **) is given, the answer is assumed.
      If no exponent (number to the right of **) is given, 2 is assumed.
      Only the integer portion of the exponent is used; any mantissa is ignored.
      When multiplying by a power, key * **.
      A negative base is converted to positive prior to the operation.
      A negative exponent is converted to positive prior to the operation.
    • Nth Root
    • //, //3, 5//, 27//3
      If no base (number to the left of //) is given, the answer is assumed.
      If no exponent (number to the right of //) is given, 2 is assumed.
      Only the integer portion of the exponent is used; any mantissa is ignored.
      When dividing by a root, key / //.
      A negative base is converted to positive prior to the operation.
      A negative exponent is converted to positive prior to the operation.
    • Absolute
    • ABsolute turns a negative answer into positive.
      Any arithmetic operator used in front of AB is ignored.
    • Random
    • RAND will generate a random number in the range 0>1.
      RAND on its own will generate a different random number on each call.
      RAND cam be used with any integer of up to 10 digits.
      A different number is returned each time RAND is used.
      RAND followed by an integer will generate the same random number each time it is called with that integer.
      ===>CONTENTS

  5. FEATURES
  6. The features provided are ...
    15 memory locations
    User names for each memory location
    User specified colours for memory values
    User name for answer
    User specified colours for answer values
    Editing
    Line numbers
    Line labels
    • 15 memory locations
    • 15 distinct memory locations are avilable.
      These may be named and edited separately.
      A Memory location can be keyed anywhere a number can be used. The number stored in that location is retrieved first.
    • User names for each memory location
    • The user can specify names for the memory locations.
      The name must start with an alphabetic character.
      Subsequent characters may be alphabetic or numeric or _ # @ $ £ €
      Alphabetic characters can be upper or lower case.
    • User specified colours for memory values
    • The user can specify colours for the value in memory locations.
      Different colours can be used for positive and negative numbers.
      The colours available are GREEN, WHITE, RED, TURQUOISE, YELLOW, PINK and BLUE.
    • User name for answer
    • The user can specify a name for the answer location.
      The name must start with an alphabetic character.
      Subsequent characters may be alphabetic or numeric or _ # @ $ £ €
      Alphabetic characters can be upper or lower case.
    • User specified colours for answer values
    • The user can specify colours for the value in the answer location.
      Different colours can be used for positive and negative numbers.
      The colours available are GREEN, WHITE, RED, TURQUOISE, YELLOW, PINK and BLUE.
    • Editing
    • The values in the answer and memory lcoations can be edited as follows .... Number of decimals
      Currency symbol
      Thousands separator
      Decimal separator
    • Line numbers
    • Each line is given an incrementing number as it is used.
      The user can replace this with a label.
      The number starts at 1 and increments to 9999
      Any numeric entries here are replaced by the line number.
      The line number can be used as a target in the UNDO, REDO and GOTO commands.
    • Line labels
    • Each line is given an incrementing number as it is used.
      The user can replace the line number with a label.
      The label must start with uppercase alphabetic, followed by uppercase characters or numbers.
      Note that the length of a label is 4 characters.
      The label can be used as a target in the UNDO, REDO and GOTO commands.
      ===>CONTENTS

  7. COMMANDS
  8. The commands provided are ...
    CA Clear Answer
    CM Clear Memory
    AM Answer to Memory
    MA Memory to Answer
    UNDO undo
    REDO redo
    GOTO goto line
    REPEAT repeat line
    • CA Clear Answer
    • CA will clear the answer to zeros.
      The most recent subtotal entry is also cleared to zeros.
    • CM Clear Memory
    • CM, on its own, will clear all memory locations to zeros.
      CM, followed by a memory location, will clear that memory location to zeros.
    • AM Answer to Memory
    • AM, followed by a memory location, will copy the answer to the named memory location.
      This replaces any value previously in that location.
      The Answer location retains the value.
    • MA Memory to Answer
    • MA, followed by a memory location, will copy the contents of the named memory location to the Answer location.
      This replaces any value previously in the Answer location.
      The specified memory location retains the value.
    • UNDO undo
    • UNDO will undo or reverse out an operation. UNDO on its own will reverse out the last operation.
      UNDO TO will undo all the operations back to and including the specified line number or line label.
      UNDO ALL will reverse out all operations. Only entries from the Edit window and line labels will remain.
    • REDO redo
    • REDO will reinstate the corresponding UNDO'd operation. REDO on its own will reinstate earliest UNDO operation.
      REDO TO will reinstate all the UNDO'd operations up to and including the specified line number or line label.
      REDO ALL will reinstate all UNDO'd operations. Note that REDO always uses current values. For example, if a memory value is changed between the UNDO and REDO of a statement using that memory value, the changed memory will be used.
    • GOTO goto line
    • GOTO will display the specific line.
      Either a line number or a line label may be used as the target.
    • REPEAT repeat one or more lines
    • REPEAT will repeat one or more lines.
      Either a line number or a line label may be used as the target.
      REPEAT 1 to 5
      REPEAT 1
      ===>CONTENTS

  9. COMMAND KEYS
  10. The following command keys are used ...
    F3 Exit
    F4 Prompt
    F5 Undo
    F6 Editing
    F7 Save
    F9 Repeat
    F10 Display Memory Locations
    F11 Goto top
    F12 Cancel
    F14 Display Command Keys
    F17 Redo
    F19 Restore
    F22 Display Legend
    F23 Bottom

  11. DISPLAY

  12.  MC101S1             MC101  ISERIES CALCULATOR SIMULATOR                2/24/10 
     PUB1                     MCKAY SOFTWARE SERVICES LTD                  13:43:27 
     JMCKAY           www.rpglanguage.com   www.mckaysoftware.ie                    
                                                                                    
     AN         1,089.24354                                                         
                                                                                    
     +  Add           **   Power          CA  Clear Answer         GOTO             
     -  Subtract      //   Root           CM  Clear Memory         UNDO             
     *  Multiply      AB   Absolute       AM  Answer to Memory     REDO             
     /  Divide        RAND Random No.     MA  Memory to Answer     REPEAT           
     !  Factorial     %    Percentage                            
                                                                                    
        1 + 1.000000           1.000000                                             
        2 + 2.000000           3.000000                                             
        3 / 3.000000           1.000000                                             
        4 * 4.000000           4.000000                                             
        5 * 8.000000           32.000000                                            
        6 + 32.000000**2       1,056.000000                1,024.00000              
        7 + 1,056.000000//2    1,088.496150                32.49615                 
        8 +  RAND              1,089.243540                RANDOM .74739            
        9                                                                           
                                                                             Bottom 
    F3 Exit   F6 Edit   F5  Undo   F7  Save      F9  Repeat   F22 Legend  F11 Top 
         F14 Keys       F17 Redo   F19 Restore                            F23 Btm                                 
     MC101S3             MC101  ISERIES CALCULATOR SIMULATOR                2/24/10
     PUB1                     MCKAY SOFTWARE SERVICES LTD                  14:00:28
     JMCKAY           www.rpglanguage.com   www.mckaysoftware.ie                   
                                                                                   
    Temporary                               L8                                     
    AirTicket  175.25                       L9                                     
    Taxi       15.00                        LA                                     
    Meals      65.30                        LB                                     
    L4                                      LC                                     
    L5                                      LD                                     
    L6                                      LE                                     
    L7                                      LF                                     
        2 am AirTicket         175.250000                                          
        3 CA                                                                       
        4 + 15.000000          15.000000                                           
        5 am Taxi              15.000000                                           
        6 CA                                                                       
        7 + 65.300000          65.300000                                           
        8 am Meals             65.300000                                           
        9 CA                                                                       
       10                                                                          
                                                                             Bottom
    F3 Exit   F6 Edit   F5  Undo   F7  Save      F9  Repeat   F22 Legend  F11 Top 
         F14 Keys       F17 Redo   F19 Restore                            F23 Btm                                                                
    
     MC101S3             MC101  ISERIES CALCULATOR SIMULATOR               11/06/09 
                              MCKAY SOFTWARE SERVICES LTD                  23:55:34 
     JMCKAY           www.rpglanguage.com   www.mckaysoftware.ie                    
                                                                                    
    Temporary                               Expenses   255.55                       
    Airticket  175.25                       L9                                      
    Taxi       15.00                        LA                                      
    Meals      65.30                        LB                                      
    L4                                      LC                                      
    L5                                      LD                                      
    L6                                      LE                                      
    L7                                      LF                                      
       10 Airticket            175.250000                                           
       11 taxi                 175.250000                  Invalid entry       
       12 Taxi                 190.250000                                           
       13 Meals                255.550000                                           
       14 am Expenses          255.550000                                           
       15 CA                                                                        
       16                                                                           
                                                                                    
                                                                                    
                                                                             Bottom 
    F3 Exit   F6 Edit   F5  Undo   F7  Save      F9  Repeat   F22 Legend  F11 Top 
         F14 Keys       F17 Redo   F19 Restore                            F23 Btm                                                                                              
    
    =+++++++++++++++++++++++++++++++++++++++++++++++=
    *                DEC CUR DEC THOU  COLOURS      /
    *                POS SYM SYM SYMB   +   -       /
    * AN  AN          5       .   ,    WHT WHT      /
    * L1  L1          5       .   ,    WHT WHT      /
    * L2  L2          5       .   ,    WHT WHT      /
    * L3  L3          5       .   ,    WHT WHT      /
    * L4  L4          5       .   ,    WHT WHT      /
    * L5  L5          5       .   ,    WHT WHT      /
    * L6  L6          5       .   ,    WHT WHT      /
    * L7  L7          5       .   ,    WHT WHT      /
    * L8  L8          5       .   ,    WHT WHT      /
    * L9  L9          5       .   ,    WHT WHT      /
    * LA  LA          5       .   ,    WHT WHT      /
    * LB  LB          5       .   ,    WHT WHT      /
    * LC  LC          5       .   ,    WHT WHT      /
    * LD  LD          5       .   ,    WHT WHT      /
    * LE  LE          5       .   ,    WHT WHT      /
    * LF  LF          5       .   ,    WHT WHT      /
    *                                               /
    *  ENTER to update                              /
    *  F12 to cancel                                /
    *                                               /
    =-----------------------------------------------= 
    
     =++++++++++++++++++++++++++++++++++++++++++++++++++++=
     *  C O M M A N D   K E Y S                           /
     *                            F14  Command Keys       /
     *  F3   Exit                                         /
     *  F4   Prompt                                       /
     *  F5   Undo                 F17  Redo               /
     *  F6   Editing                                      /
     *  F7   Save                 F19  Restore            /
     *                                                    /
     *  F9   Repeat                                       /
     *  F10  Display Memory       F22  Display Legend     /
     *  F11  Goto Top             F23  Goto Bottom        /
     *              F12  Cancel                           /
     *                                                    /
     =----------------------------------------------------=
    
    ===>CONTENTS

  13. To run MC101
  14. Command MC101C calls the program MC101.
    There are no parameters to the command nor the program.
    This is a stand-alone program.
    The screen file is MC101FM.
    A configuration file MC101CFG holds configuration settings from one run to the next. A log file MC101LOG can be used to save data from a run. This can then be restored in a future run. Similarly, the edit setting - colours, decimal positions, currency symbol, decimal and thosuands separator, can be saved and restored in MC101TMLT. Finally, data in the memory locations can be saved and restored in MC101MRY.
    Activation group is *CALLER.
    The objects can be stored in a library of your own choice.
    ===>CONTENTS
  15. SAVEFILE
  16. The objects are provided in a savef MC101SAVF.  To restore the savef, first create a savef on the AS400. Use FTP with binary to upload the file to the savf you created.
    You may then move the contents to a library or libraries of your choice.
    ===>CONTENTS

  17. SHIPPING LIST
  18. The following objects are shipped in the savefile MC101SAVF ...
    MC101CCMDThis is the command which calls the program.
    MC101CLCL programCalculator emulation program - creates userspaces, CFG file.
    MAKESPACECMDCommand to create userspace, wraps api QUSCRTUS.
    MC101RPGLE programThe calculator emulation program.
    MC101FMScreen fileScreen layouts
    MC101SRCSource fileThis contains the source for the commands MC101C and MAKESPACE and CLP MC101CL.
    ===>CONTENTS


  19. Change Log V1.0

  20. Initial release of MC101
    ===>CONTENTS


27 June 2010
©2010 McKay Software Services Ltd
www.mckaysoftware.ie
www.rpglanguage.com
End of README v1.1