HP Forums
Select subexpression in equation - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Select subexpression in equation (/thread-6640.html)



Select subexpression in equation - Sanctuary - 08-01-2016 11:04 AM

Hi,
Recently got an HP Prime and I love it, but there is one thing that drives me insane. It probably is just a lack of user knowledge but I cannot for the life of me figure out how to select/edit subexpressions in equations.

I have to admit I have always been a 'sloppy' equation writer so I don't necessarily think too much about parentheses and ordering beforehand. On the previous HPs (previously owned 28S, 48SX, 49G and 50G - still use that last one) this didn't matter as I could always select a subexpression and edit it further. On the Prime however I cannot figure out how to do this.

Example 1: I start writing x+1/y ... and then realise that I actually meant to write (x+1)/y, so have to go back add a () at the start, remove the ), add a () at the end, remove the (, etc. All a bit tedious. On the 50G this is easy, just press "up" key twice and then press "/" and all is good again.

Example 2: I have this expression: (1+x+a)/(1+x-a). I want to change it to (1+sqrt(x+a))/(1+sqrt(x-a)). I cannot figure out how to do this other than re-entering the equation from scratch. On the HP50G (&co) I could just select the subelements x+a and x-a and apply the sqrt to these components.

If anyone can tell me how to do this, I would be eternally grateful.

Regards


RE: Select subexpression in equation - Fortin - 08-01-2016 01:22 PM

Right now, there isn't a perfect solution, but you can go into Home settings and change the entry mode from textbook to algebraic, make the edits and switch back. Creating a user key to toggle between Entry:=1 and Entry:=0 can make this process much less tedious and keeps the text that's already on the entry line. It's also helpful to create two more user keys: one that returns "(" and another that returns ")". This makes inserting parentheses after the fact much easier.


RE: Select subexpression in equation - Fortin - 08-01-2016 02:23 PM

The following assigns the textbook<->algebraic toggle code to the Shift-EEX (Sto>) key. The startview switches to the home settings (-2) while the change is made so that the entry line is updated when returning to Home (-1).

KEY KS_Eex()
BEGIN
STARTVIEW(−2,0);
Entry:=IFTE(Entry==0,1,0);
STARTVIEW(−1);
RETURN "";
END;


RE: Select subexpression in equation - Sanctuary - 08-02-2016 04:05 AM

Well that's disappointing ...

What I find frustrating is that it seems like the functionality is 'almost there', i.e. I can already click and drag to select sub-expressions, but when I press a key like SQRT, the whole sub-expression is then just replaced instead of edited. I am pretty sure it wouldn't be so hard to just take the selected piece and put it into the new expression (trivial for unary operators, but still could have a common sense default for things like fractions)

But thanks a lot for the code-snippet! That helps, especially for my example 2.


RE: Select subexpression in equation - Fortin - 08-02-2016 02:02 PM

(08-02-2016 04:05 AM)Sanctuary Wrote:  I can already click and drag to select sub-expressions, but when I press a key like SQRT, the whole sub-expression is then just replaced instead of edited.

After selecting the text, press shift-view (copy), press the 'cut' softkey, insert the new token (sqrt for example), and then paste the cut text.

If you choose to use the copy function's begin/end instead of click and drag method to select text, try to position the cursor before pressing shift-view (copy) and you'll save a begin or end press.

I would like to see a 50G-style equation editor introduced to Prime - both for direct entry and for selecting partial text from history. A touch interface would be a very welcome addition.