' ================================================================
'   ID-PHY - RPN Calculator 
'   
'   Help file
'
'   First characted of the line is a control character :
'   (Like in "old good time" for printer ;-) )
'
'   ' : Comment line (not displayed in help, like this header)
'   + : Page break (rest of line not displayed)
'   Text color (uncomment to test) : 
'** : White
'ww : White
'WW : White  hilighted
'yy : Yellow
'YY : Yellow hilighted
'bb : Blue
'BB : Blue   hilighted
'ee : Electric (Light Blue)
'EE : Electric hilighted
'gg : Light Green
'GG : Green  hilighted
'rr : Red
'RR : Red    hilighted
'oo : Orange (Light Red)
'OO : Orange hilighted
'nn : Noir   (Black)
'NN : Noir   hilighted
'mm : Light Magenta
+---------------------------------------------------------------------+

Y                                                                       
Y       RPN Calculator                                                  
Y                                                                       

y   An RPN calculator, working as old HP calculators
y   with infinite stack, trigonometric and finance functions,
y   conversions, editable & replayable history of operations,
y   user defined functions, ...

E   Author  : Pierre Hardy    
B   Version : 4.1, July 2007  



O   More info at : http://users.swing.be/id-phy/CALC/CALC.html   
                                                            
o Copyright Pierre Hardy, 2004 - 2007. All rights reserved. 
m The program may be freely used and distributed.
+---------------------------------------------------------------------+
E Base Operations 
*Number Input :
  0 - 9, e,  . or , : Digits, Exponent sign, Decimal point
  = : '-' sign (only if entered before digit)
  INS : Change sign, anywhere in number input (+/- toggle)
  <- / DEL : Correct / Delete, if empty input : delete x
*Basic functions :                       
  +, -, *, /, %, Enter : basic operators                     
  ~ : Change sign operator (end entry)   i : 1/x : Invert
  ! : n!  : Factorial(x)                 d : Delta % : (x/y)-1                   
  ` (back quote) or small 2 : Square     v : v   : Square root                   
  q : x^3 : Cube                         ^ : y^x : y raised to power x          
  l : LN  : Logarithm Neperian           L : Log : Logarithm base 10
  p : e^x : e to the Xth power           P : 10^x: 10 to the Xth power
*Stack movements :  
  <,> or LEFT, RIGHT arrows  : Swap x and y
  UP, DOWN arrow : Scroll stack           

*ESC : Exit
+---------------------------------------------------------------------+
E Extended Functions 
g  Accessed by pressing 'f' or 't' first

*f : Finance functions :              t : Trigonometric functions :
  d   : Display/Hide Finance Reg.      d,r   : Degree, Radian mode
  b,e : Begin/End of period            p     : Pi (3.141592...)
  m,y : Monthly/Yearly Annuity         s,c,t : Sine, Cosine, Tangent
  c   : Clear Finance registers and    S,C,T : ArcSin,ArcCos,ArcTangent
        restore setting to End & Yearly     
m  Computes (assuming all 4 other values are provided) :
  n : Number of annuities
  r : Rate (yearly rate in %)
  p : Present value
  a : Annuity (payment)
  f : Future value
  
B Negative value = Cash out 

b  After execution of finance function, Finance registers changes form
b  Magenta to Green, and indicator in status bar switch form '-' to '*'
+---------------------------------------------------------------------+
E Memory Operations 

*Direct Memory functions (on Mem register) :
  F2 : Increment memory (+1)        F3 : Store       F4|m : Recall
  F5 : Store +     F6 : Store -     F7 : Store *     F8   : Store /

*Stack and Registers operations :
  x, y, m : Recall Last x, Last y or Direct Memory (Mem register)
  s[+|-|*|/] <R> : Store to <R> (with optional operation [+|-|*|/]),
  r <R> : Recall <R>,
    <R> is : 0 - 9     : for Register number
             .0 - .9   : for Stack number
             x, y, m   : for Last x, y or Memory
             n,r,p,a,f : Finance registers (see Finance functions)
o                        Numbers stored to 'r' are converted to %
             c         : Currency rate
             i for Indirect : Register number specified as 'Mem mod 32'
b Examples: s1  s*.2  s+y  ri  r.4  m  sf  x

y Stack is infinite & circular.
+---------------------------------------------------------------------+
E Rename, Clear, Save and Reload 
*Register rename :  
  n <R>|[Usr Fn] : Set register <R> or "User Function" Name (Press Fn)
*File functions :
  Shift-F1 : Cycle on Save modes   Shift-F2 : Print to File
  Shift-F3 : SAVE  all to file     Shift-F4 : RELOAD from file & Replay
*Clear operations and 'Save on exit' options :
G              |    CLEAR      | SAVE  
 KEY/SAVE Flag |N R K Y c C A M| .-+*#X  ' ' Clear all but :
  User Fn & Cur|              x|xxxxxx-      - User Functions & names
  Status Flags |              x| xxxxx-      - Currency rate & "name"
  Names        |x           x x|  xxxx-      - Mouse TimeOut (Ctrl-t)
  Registers    |  x       x x x|   xxx-
  StacK        |    x   x x x x|    xx-  'X' Exit without saving
  HistorY      |      x x x x x|     x-      => will restart as prev.
oCtrl-DEL or M : "Factory reset" or "Memory Lost" (~= .INI file delete) 
gClear History also reset Trig. & Fin. modes to initial (saved) state.
bCurrency rate & User Functions & names are only cleared with Ctrl-Del
bTo clear User Function, delete its label then clear History (& Names)
+---------------------------------------------------------------------+
E Conversions 

*Sexagesimal conversions :
  h : HR->HH:MM:SS : conversion to sexagesimal
  H : HH:MM:SS->HR : conversion to Decimal

*Currency conversions :
g Currency rate is stored in 'c' register : BEF/EUR in default example.
g Corresponding name "EUR>BEF" used (needs a Replay after rename) :
g   - to re-label mouse keys as [EUR] [BEF] (at left of HMS)
g   - as Function name in history "EUR>BEF" or "BEF>EUR"
  Pound symbol or AltGr-b    : multiply by rate (to "BEF" or Local )
  $ or AltGr-e (Euro symbol) : divide   by rate (to "EUR", USD, ...)

*Metric to Imperial conversions :

m  Only available through "Mouse pad".

+---------------------------------------------------------------------+
E More functions ... User defined ! 
*User Functions keys :
g Up to 8 User Functions can be defined
  Alt-F1...F8 : Creates a User Function (insert a Label in History)
  Ctrl-F1..F8 : Executes corresponding User Function (if defined)
  Alt-F9..F12, Ctrl-F9..F12 : Go to label 1-4, 5-8
  Ctrl-End : Return (end function)
  U : User mode toggle : Swap F1..F8 with Ctrl-F1..Ctrl-F8 functions 
m A function is terminated by either Return or Goto function.
m Visually, functions are between { }, and grayed in History.
*Mouse operations :
  Click on : Key Number to insert a Label (define function)
             '>' sign for "Go to"
             Function Label (default is "Usr Fn") to Execute
g When defined, function key color (on mouse pad) will change to blue
g Function label (renamed) will be used in History (Replay to refresh)
b User functions are stored in History, but not cleared with History.
b Functions at top of History are "hidden" above screen, ending with
b [^^^^^^^] : automatically added after last "hidden" function,
b making it the first visible "operation" (can be deleted).
+---------------------------------------------------------------------+
E ... and now the MAGIC ! 

*History Navigation :
  ESC   : Quit history mode         TAB : Switch to/from history
  ENTER : Recall value (and exit)   F9  : Cycle on edited values
  Arrows, Home, End, Page Up and Page Down : Navigate in history 

*History Edit :
g Overwrite on input or result field, correct with Backspace
g Quit with Escape and Validate with any other key.
b Value set in CYAN and Operator set on BLUE until next Replay
  DEL : Mark line to be DELETED     INS : Fix / Release result value
  F10 : Operation skip mode :
    Skip (BROWN): skip one line
    Break (RED) : skip until next break or until end

wHistory Replay :
  F11 : Replay step by step then ...       
  F12 : Replay all : Re-RUN / Refresh 
+---------------------------------------------------------------------+
E ... MOUSE & Display ... 
*Mouse operation :
  \ or Click on [Arrow] (upper right corner) : 'Mouse keypad' toggle.
b   Mouse Keypad should be self explanatory, most map to key strokes.
B Double click on any value to recall it ! 

*Status bar 'mouse toggles/keys' :
  First characater : cycle on "Save on exit" mode
  STD|USR  FIX|Fix|SCI|Sci  REG|STK  RAD|DEG  BEG|END  YRL|MTL HELP [^]
  -|* (between BEG and YRL) : Finance display      (c) : Quick exit
  F|S toggle between SCI|FIX, last two between Mixed & Same Format
*Display format :
  F n : FIX mode (n Decimals)     S n : SCI mode (n Decimals)
  #   : Toggle between Mixed (Fix|Sci) and Same (FIX|SCI) Format
  D   : Display mode toggle : Stack/Register precedence (over Reg/Stk)
  MixFmt : Mixed Format, numbers displayed as when entered : Fix or Sci
  SmFmt  : Same Format, all displayed as current setting : FIX or SCI.
b Number of decimals applies to all.  Refresh (F12) to update History.

YMore info at : http://users.swing.be/id-phy/CALC/CALC.html 
+---------------------------------------------------------------------+
E ... in alphabetical order 
 Only direct key entry are listed here, not the suffix (store/recall),
 subfunctions (like in Trigonometric, Finance functions).
 a :                            A : clear All: names, reg, stk & hist.
 b :             
 c : clear stack and history    C : clear registers, stack and history
 d : delta %                    D : toggle display mode Stack | Register
 e : E character in numbers
 f : finance functions          F : Fix (Floating) display format
 g : 
 h : convert to sexagesimal     H : convert to decimal
 i : invert : 1/x
 j : 
 k :                            K : clear stacK
 l : LN : logarithm neperian    L : LOG : logarithm base 10
 m : recall memory              M : Memory reset
 n : register re-Name           N : clear register names
 o : 
 p : e^x                        P : 10^x
 q : cube : x^3
 r : recall                     R : clear registers
 s : store                      S : Scientific (Exp) display format
 t : trigonometric functions
 u :                            U : User | Std mode toggle
 v : square root
 w : 
 x : Last x
 y : Last y                     Y : clear historY
 z : 
 0 - 9 : digits                 ,. : decimal separator
 + : plus                       - : minus
 * : multiply                   / : divide
 % : percentage                 ! : factorial
 ~ : change sign                = : minus sign
 ^ : power                      ` , [small 2] : square
 $ : From Currency conversion   Pound symbol : To Currency conversion
 AltGr-e (Euro sympbol): idem   AltGr-b      : idem -^ 
 \ : Mouse pad toggle           # : Mixed | Same Format mode toggle
 ESC : quit / exit              TAB : to/from History
 F1 : Quick Help                Shift F1 : Cycle on Save mode
 F2 : Mem + 1                   Shift F2 : Print
 F3 : Store to Mem              Shift F3 : Save
 F4 : Recall Mem                Shift F4 : Reload
 F5 : Store + Mem
 F6 : Store - Mem
 F7 : Store * Mem
 F8 : Store / Mem
 F9 : Go to previous edited
 F10 : Toggle skip | break | normal mode
 F11 : Step by step run
 F12 : Replay : run all
 Alt-F1..F8  : Label 1 .. 8     Ctrl-F1..F8  : Execute Fct 1 .. 8
 Alt-F9..F12 : Go to 1 .. 4     Ctrl-F9..F12 : Go to 5 .. 8