HP50g variables


I was a good boy last year (I guess) and Santa brought me a new HP50g for Christmas. The learning curve for using this thing seems steep and long. A simple question for now if I may (more will follow I'm sure)...

Is there not a simple way to overwrite a new value into a variable? I know you can purge the variable and then create it again with the new value in it, or you can go into the files directory, scroll, find and select the variable, page forward to the edit command and do it that way, but geez, both of these methods take a dozen keystrokes or more.
Is there no way to condition a variable to behave like a storage register in the old RPN models, where a new value could be overwritten in with 2 keystrokes?

Thanks, and Happy New Year to All!!



Is there no way to condition a variable to behave like a storage register in the old RPN models, where a new value could be overwritten in with 2 keystrokes?

There is a way! Quoting from the HP-28S Owner's Manual, page 300:


Registers Versus Variables

Fixed-stack calculators can deal efficiently only with real, floating-point numbers for which the fixed, seven-byte register structure of the stack and numbered data register memory is suitable (the HP-41 introduced a primitive alpha data object constrained to seven-byte format). The HP-28S replaces numbered data registers with named variables. Variables, in addition to having a flexible structure so that they can accomodate different object types, have names that can help you remember their contents more readily than can register numbers.

If you want to duplicate numbered registers on the HP-28S, you can use a vector:

           { 50 } 0 CON 'REG' STO 

creates a vector with 50 elements initialized to 0;

        << 'REG' SWAP GET >> 'NRCL' STO 

creates a program NRCL that recalls the nth element from the vector, where n is a number in level 1;

     << 'REG' SWAP ROT PUT >> 'NSTO' STO 

creates the analogous store program NSTO.


This also applies to the HP-50G. I would suggest you created these programs in the HOME directory so they can be accessed from all inner directories. You can also add NSTO and NRCL to your custom directory or create it, in case you haven't done it yet:

     { NSTO NRCL } 'CST' STO 

Now press the white shift key then the MODE/H key. You'll have NSTO and NRCL soft keys. Let's say you want to store the number in level 1 in register 9. All you have to do is pressing two keys:

     9  A 

(assuming your CST variable is {NSTO NRCL})

Likewise, to recall register 9, only two keystrokes are needed:

     9  B 

Of course only registers 1 through 9 can be overwritten with only two keystrokes.

Enjoy your Christmas gift!

Best regards,



Contrary to what I thought, saving the programs in the HOME directory is not enough to assure they can be called from inner directories. It appears NRCL may work if it is changed to

        << REG SWAP GET >> 'NRCL' STO 

Actually, this is a simulation of the numbered registers that are common in RPN calculators. I remembered I missed the convenience of numbered registers when I started using the HP-28S, until I finished reading the manual...

Edited: 1 Jan 2007, 12:49 p.m.



It is possible to overwrite a new value into a variable in two keystrokes.

Get into the VAR menu and find the variable you want to overwrite. Key in the new value, press Left Shift and then the menu soft key. The Left Shift/Soft Key combination is the same as typing the variable name and then STO, and is intended as a shorcut of sorts.

For instance, if you stored 7 into the variable A using 7 'A' STO and want to replace it with 8, key in 8, Left Shift and F1, provided you just created variable A.

Objects in the VAR menu can be overwritten in this way.

Hope this helps. And enjoy your calculator.


Thanks very much for your responces.

The left shift trick to overwrite into the variable is exactly what I was looking for...Thanks Juan

The nifty program to create pseudo numbered registers is great!!
I'm going to put it in right now...Thanks for that Gerson.

Now a bit of speculation if I may...

Why do you suppose such usefull information is not in the 50g users manual or users guide? Perhaps I just missed it, but I did scour the applicable section on variables in both documents, but only came up empty (and frustrated).

Anyway, thanks again and best regards, Hal


You *must* get this (if you haven't already)

As for why theres nothing in the guides. Who knows. There are some good tips in Appendix G of the User Guide. Maybe they just forgot about the L-shift trick.



Good to know the trick helped.

There is a lot of useful insights that apply to the HP-50G in the HP-48G User's Manual, including shortcuts. You should get a copy for reference.

As to why things like these are missing in the HP-50G's User's Manual, one can only guess. HP manuals'quality has declined significantly for quite a while.


Also see the hp 49g+/ hp 48gII graphing calculator
advanced user’s reference manual

From a programming standpoint, the only addition for the 50g is the use of flag -78, clear for USB port transfers, set for serial port transfers.

For that matter, if you use a current ROM on a 49G, the only differences are that IR isn't available, so setting flag -33 disables transfers, and setting flag -34 disables printing, and of course that the 49G doesn't have an SD card port.

Well, actually there are also the differences that the 49G can't use the new Saturn+ assembly language instructions or the opcodes that invoke operations on the ARM processor, but for RPL it's the same.


Edited: 4 Jan 2007, 5:53 a.m.


James, I really like the change in the unshifted reference to the variable named x. I know integration is not the only use of x, but it has the greater impact on timing for my useage. I think of my single independent CAS variable as x nearly all the time now, even when THETA would be more descriptive, OR as U when substituting.


The STO command overwrites any variable you want as a global. Don't forget to study up on the local variables when you need them only for the duration of a program or function statement. If you are using RPN, not to be confused with RPL, be careful about how you pay forward multiple programs or functions. LOCALS that are expected to have integrity more than one level beyond the level that creates them must be COMPILED LOCAL VARIABLES with a special naming convention, otherwise, be prepared to redefine locals at every stage. If you have no intentions of creating code to compile more basic and interpretive language, I would still advise you to have a copy of the advanced user reference handy to look more deeply into the commands.


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP: Dump the predefined variables! bluesun08 12 945 11-19-2013, 02:18 PM
Last Post: bluesun08
  HP Prime - local variables retain their initial type BruceH 4 514 11-10-2013, 12:42 PM
Last Post: Michael de Estrada
  Shutdown with the Apps key and more than 10 variables in a program. Davi Ribeiro de Oliveira 10 965 11-05-2013, 01:26 PM
Last Post: Han
  HP Prime: Number of external Variables Davi Ribeiro de Oliveira 0 253 11-01-2013, 08:10 PM
Last Post: Davi Ribeiro de Oliveira
  HP Prime variables Davi Ribeiro de Oliveira 3 415 10-31-2013, 02:24 AM
Last Post: cyrille de Brébisson
  HP Prime - deleting variables bluesun08 1 281 10-29-2013, 06:36 PM
Last Post: Joe Horn
  HP Prime: CAS Variables - -How to save? Helge Gabert 2 382 10-27-2013, 11:26 PM
Last Post: Helge Gabert
  HP Prime Solver Variables Issue Anibal Morones Ruelas 8 811 10-19-2013, 09:45 AM
Last Post: Harold A Climer
  Prime RPN storing variables kris223 3 382 09-19-2013, 03:49 PM
Last Post: kris223
  hp50g screen weird line Sok-khieng Chum Hun 2 369 09-10-2013, 08:11 AM
Last Post: Sok-khieng Chum Hun

Forum Jump: