HP Prime Things I can't figure out how to do



#12

I'd appreciate comments on a few things I can't figure out how to do on the Prime that were very easy on the HP48/49:

1) How do I use STO> from within RPN mode?
2) How do I quickly create a function that will take items off the stack as inputs? For example, I'm trying to use DEFINE to accept a,b,c off the stack and output both solutions of a quadratic.
3) In a related question, how do I use stack values from within programs? I know I can use INPUT, but I'd rather use previous results from the stack as inputs.

This is a great calculator, I hope that RPN gets better support in a future release.

Thanks for the help.


#13

Hi Bruce

see in archive 21 :
HP Prime - RPN stack access from programs?

and for the parms in RPN :

Re: Prime B->R()
Message #4 Posted by Tim Wessman on 20 Sept 2013, 11:50 a.m., Report post,
in response to message #3 by kris223
You specify the argument count inside the paren for commands that accept multiple variants of input. B->R(3) for example. An empty value means the lowest or default number.
TW

Didier.

#14

Quote:
I'd appreciate comments on a few things I can't figure out how to do on the Prime that were very easy on the HP48/49:

1) How do I use STO> from within RPN mode?
2) How do I quickly create a function that will take items off the stack as inputs? For example, I'm trying to use DEFINE to accept a,b,c off the stack and output both solutions of a quadratic.
3) In a related question, how do I use stack values from within programs? I know I can use INPUT, but I'd rather use previous results from the stack as inputs.

This is a great calculator, I hope that RPN gets better support in a future release.

Thanks for the help.


1. Use the single quote delimeter -- [Shift] [()] -- to specify a variable name. So typing something like:

45 'MYVAR' STO

They key-press for STO is [Shift] [EEX]

2. Either write a program, or create a CAS program. Here's how to make it a program

[Shift][1] to open the program editor, and create a new program (call it QUADSOL)

EXPORT QUADSOL(a,b,c)
BEGIN
LOCAL d;
d:=(b^2-4*a*c)^(1/2);
RETURN({(-b+d)/(2*a), (-b-d)/(2*a)});
END;

Use: QUADSOL(1,2,1) produces {-1,-1}

3. For now, programming is limited to HPPPL (HP Prime Programming Language) aka HP Basic. Hopefully HP will add RPN programming.


#15

Wow. I just got this calculator, and cannot for the life of me figure out how to store a value. I've tried to replicate your example, but it keeps giving me an error. So for now, I can't do much in rpn mode.

Edit. I figured it out. I needed to first define the variable "MYVAR" before I could store anything in it. This wasn't necessary with my HP 50g.

Edited: 10 Oct 2013, 8:50 p.m.


#16

OK, so now I have another problem. I successfully created a real variable "MYVAR" and stored a value in it. Now I wish to un-create this variable, so I enter the CAS screen and type "purge(myvar)" and get the message "No such variable myvar" I also tried with all caps to no avail. what gives ?


#17

Only way to remove variables at the moment is through UI (vars->user->select it [BKSP]). Prime is not meant to replicate a 48 with directory structure, extensive variable usage and so on at the moment. While I suspect it will move in that direction, the ability to organize variables, programs, and so on just really isn't the same right now. Since all variables must exist prior to parse time in the numeric side of the system, removing variables programatically causes all sorts of potential problems.

If your myvar was a CAS variable, then yes it would have worked just fine in the CAS exclusive purge command.

TW


#18

Thanks Tim.

I guess my problem is that I'm used to the HP 48SX and HP 50g, and the Prime is more an extension of the HP 38, which I've never owned. In fact, my progression goes all the way back to the HP 28C and 28S, and all my programming has been in RPL.

BTW, I've already somehow managed to lock this beast up while monkeying around with the spreadsheet, and needed to do a hard reset with a paper clip.

Edit: I tried what you suggested, but it did not purge the variable.

Edited: 11 Oct 2013, 11:08 a.m.

#19

Paging Tim Wessman

Quote:
Only way to remove variables at the moment is through UI (vars->user->select it [BKSP]).

This does not work. All it does is erase the variable name in the command line. It does not purge it. If it is possible to create named variables, then it should also be possible to remove them.


#20

Quote:
Tim Wessman: "Only way to remove variables at the moment is through UI (vars->user->select it [BKSP])."

This does not work. All it does is erase the variable name in the command line. It does not purge it.


It took me also a few trials, but Tim's method DOES work!

The problem is that you MUST NOT select the variable (you want to purge) in this menu with the mouse (in the emulator), because then it gets copied to the commandline and the menu disappears and so of course BKSP doesn't work anymore!

If you open this menu vars->user, then you have to navigate to the variable (which you want to purge) with the CURSOR keys (and just select it but NOT press ENTER or click with the mouse on it), and then press BKSP - this in fact removes/purges the variable.

BTW, for Tim: If you define a variable by varname:=value, then IMO it would be nice if you could remove the variable again by varname:= (i.e. without any value) - this is the usual method in some other CAS and/or math programs.

Franz


Edited: 13 Oct 2013, 4:57 a.m.


#21

Thanks Franz.

The confusion was that since I only had one user variable it was selected as soon as I pushed the user soft button on the touchscreen. So all I needed to do at that point was to push the backspace key. As soon as I did this, the user button disappeared, since I no longer had any user defined variables. When I pushed the variable name on the touchscreen I was actually entering it on the command line as you stated, such that it could no longer be purged.

#22

Thanks for the response. I've tried the basic program, but now I can't seem to get a key assignment to work. If I write:

KEY K_Neg(A,B,C)
BEGIN

RETURN {((-B+¡î(B©÷-4*A*C))/(2*A)),((-B-¡î(B©÷-4*A*C))/(2*A))};

END;

and then put 3 values on the stack, hit Shift-Help (for 1U) and then the +/- key, it doesn't run the program, just negates the value on level 1 of the stack.

Any ideas?


Possibly Related Threads…
Thread Author Replies Views Last Post
  There are some things the HP 50g does better than the HP Prime Michael de Estrada 19 5,383 11-04-2013, 01:09 PM
Last Post: Michael de Estrada
  Fun things found by running strings on the 39gII emulator bhtooefr 11 3,890 05-16-2013, 12:40 AM
Last Post: Mic
  On ode to the -41CL; Sometimes its the little things... Dan Grelinger 3 1,546 03-09-2013, 11:07 PM
Last Post: Monte Dalrymple
  Things that go bump in the night... BruceH 1 1,181 06-07-2012, 03:03 PM
Last Post: Oliver Unter Ecker
  9-figure 10b Gerson W. Barbosa 5 1,760 08-03-2010, 06:34 PM
Last Post: Gerson W. Barbosa
  How about a poll to liven things up (some more!) Martin Pinckney 19 4,603 10-26-2009, 08:08 PM
Last Post: DaveJ
  Things that surely will condemn us to HP Hell Sean Connor 15 3,626 10-02-2009, 03:23 AM
Last Post: Jérôme Grandjanny (France)
  Things 35s - Purely Superficial... Dallas Osborne 11 2,871 08-19-2007, 07:03 PM
Last Post: Vincze
  Two things I don't get... Kilroy 10 2,778 01-02-2007, 07:10 AM
Last Post: Maximilian Hohmann
  ASTRONAV software, HP-41X and other things ... HrastProgrammer 15 3,908 02-13-2004, 06:19 AM
Last Post: Meindert Kuipers

Forum Jump: