Lacking feature: multiple ans / answer calls for keyboard

Issue #466 new
Former user created an issue

Originally reported on Google Code with ID 466

Currently SpeedCrunch only allows for 1 ans call (via typing), and it's for only the
last expression input. I think it would be an extremely useful feature to allow multiple
answer/line calls to be made with the keyboard. Right now it is only possible with
the mouse, by double-clicking the expression, or it's corresponding answer (depending
which you want), and that is a large hassle for those who want to only use the keyboard.

Each line in the history will have a number assigned to it, and the value of that line
could be recalled by calling "ans" as a function, with the line number as the argument.

ex.
1| 5+5
= 10
2| 1+12 
= 13
——————-
ans(1)*22

There would be two ways of numbering the lines; an absolute count upwards chronologically,
or a relative count backwards from the most recent expression.
Each have their own pro and con and I'm not sure which one would be better.

Upwards counting has the advantage of remaining consistent in history (ans(1) will
always be the same value), but has the downside of having large numbers after a long
period of using the program (ex. ans(121) for the last answer)
Backwards counting has the advantage of small numbers (ans(1) would be the last answer),
but the disadvantage(?) that it's value is not consistent, so it would change if that
line was ever called again (such as calling the ans function of an expression using
another ans function)

Personally I'm leaning more towards backwards-counting.

Such a feature already exists in this good online/web-app calculator:
http://www.alcula.com/calculators/scientific-calculator/

Reported by my_emale@hotmail.com on 2014-01-15 18:29:53

Comments (4)

  1. Former user Account Deleted

    Reported by helder.pereira.correia on 2014-11-28 17:23:58 - Labels added: Type-Enhancement

  2. Former user Account Deleted
    I like the idea. I know how to implement finding the previous answer:
    - a minus number, starting from -1 (§0§ with or without minus is same as §ans§) means
    "Start from the beginning of the list".
    - a plus number, starting from 1 (same as above with zero) starts from the previous
    answer, §1§ being equivalent to §ans§.
    
    SC would look for, RegEx, §ans *\(§ to know to start accepting the number as location
    for previous answer. If there are no brackets, then it's regular §ans§. §ans§ continued
    (with or without a space) with a number would equal syntax error.
    
    Additionally, when you enter a number, with or without minus, into the brackets of
    §ans§ like §ans(-1§ (with or without the closing bracket) you get the formula and the
    answer as a tooltip, like when §-1§'s formula was §2+5-1*9§ and the answer is (calculated)
    §-2§, so the tooltip will be §-1 => 2+5-1*9 = -2§. It should be possible to show the
    tooltip even without modifying the bracket's contents, but if not then no problem.
    
    Clear as water.
    

    Reported by JouniJarvis on 2014-11-28 17:42:20

  3. Former user Account Deleted
    @JouniJarvis I'll be waiting for a pull request from you :)
    

    Reported by helder.pereira.correia on 2014-11-28 17:55:17

  4. Former user Account Deleted
    Sorry, no, not with my C[++], otherwise yes.
    

    Reported by JouniJarvis on 2014-11-28 17:56:55

  5. Log in to comment