HP Forums
Simple HP Prime Program - 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: Simple HP Prime Program (/thread-7148.html)



Simple HP Prime Program - cmadon - 11-01-2016 05:43 PM

On my previous HP calculators I've had a very simple program for metric conversion.

Name: MM
<< 25.4 / >>

Name: IN
<< 25.4 8 >>

I would place a number on the stack and hit the softkey with the function I wanted.

I can't figure out how to achieve this on the HP Prime. Can someone please point me in the correct direction.

Also, I am using the RPN input format.

Thank you.


RE: Simple HP Prime Program - toml_12953 - 11-01-2016 05:50 PM

(11-01-2016 05:43 PM)cmadon Wrote:  On my previous HP calculators I've had a very simple program for metric conversion.

Name: MM
<< 25.4 / >>

Name: IN
<< 25.4 8 >>

I would place a number on the stack and hit the softkey with the function I wanted.

I can't figure out how to achieve this on the HP Prime. Can someone please point me in the correct direction.

Also, I am using the RPN input format.

Thank you.
create a function:

Code:
EXPORT MM(x)
BEGIN
  RETURN x/25.4;
END;

Then to convert 16 mm to inches, call it like this:

16 <Enter>
MM(1) <Enter>


RE: Simple HP Prime Program - cmadon - 11-01-2016 06:03 PM

Thanks a ton.

One additional question, how can I save this to a softkey and have it so I type the number then just press the associated softkey?