The Museum of HP Calculators

HP Forum Archive 16

[ Return to Index | Top of Index ]

HP50g variables
Message #1 Posted by Hal Bitton on 1 Jan 2007, 5:58 a.m.

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!!
Hal

      
Re: HP50g variables
Message #2 Posted by Gerson W. Barbosa on 1 Jan 2007, 8:21 a.m.,
in response to message #1 by Hal Bitton

Quote:
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,

Gerson.

--------------

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.

      
Re: HP50g variables
Message #3 Posted by Juan J on 1 Jan 2007, 11:42 a.m.,
in response to message #1 by Hal Bitton

Hello,

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.

            
Re: HP50g variables
Message #4 Posted by Hal Bitton on 1 Jan 2007, 3:35 p.m.,
in response to message #3 by Juan J

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

                  
Re: HP50g variables
Message #5 Posted by Matt on 1 Jan 2007, 4:04 p.m.,
in response to message #4 by Hal Bitton

You *must* get this (if you haven't already) http://www.hpcalc.org/details.php?id=4910

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.

                  
Re: HP50g variables
Message #6 Posted by Juan J on 2 Jan 2007, 10:24 a.m.,
in response to message #4 by Hal Bitton

Hello,

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.

                        
49 series AUR manual
Message #7 Posted by James M. Prange (Michigan) on 4 Jan 2007, 5:48 a.m.,
in response to message #6 by Juan J

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.

Regards,
James

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

                              
Re: 49 series AUR manual
Message #8 Posted by Ron Alabama on 11 Jan 2007, 11:32 p.m.,
in response to message #7 by James M. Prange (Michigan)

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.

      
Re: HP50g variables
Message #9 Posted by Ron on 2 Jan 2007, 1:53 a.m.,
in response to message #1 by Hal Bitton

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.

Ron


[ Return to Index | Top of Index ]

Go back to the main exhibit hall