The Museum of HP Calculators

HP Forum Archive 19

[ Return to Index | Top of Index ]

HP 42S Programming
Message #1 Posted by Howard Jones on 7 Oct 2009, 9:35 p.m.

I have put a simple little programme into my 42S

I want the result to be displayed as

New$KG= (the calculated value) All on the x line. It will not do that (my HP 41 does)

Relevant last lines are 13 x (This is the final multiplication to give the result I want) 14 CLA (If I don't do this every time I run the programme the statement in line 15 is added to each other multiple times. 15 (append sign like a plus with the left horizontal arm missing) "NEW$KG=" 16 AVIEW 17 END.

      
Re: HP 42S Programming
Message #2 Posted by Vieira, Luiz C. (Brazil) on 7 Oct 2009, 10:49 p.m.,
in response to message #1 by Howard Jones

Hi, Howard;

in order to show the message you want, you should append the number you want to current ALPHA contents. If the number you want to add, referred to as (the calculated value), is in the X-register, you should use:

15 "NEW$KG="
16 ARCL X (appends X-register contents to ALPHA)
17 AVIEW
18 END
Please, let us know if it works.

You can eliminate the line #14 (CLA) if you do not append line 15 (text itself). If you simply key in a text instead of appending it (the addition sign without the left arm, as you described), the new text erases all previous ALPHA contents.

Cheers.

Luiz (Brazil)

Edited: 7 Oct 2009, 10:52 p.m.

            
Re: HP 42S Programming
Message #3 Posted by Howard Jones on 8 Oct 2009, 2:04 a.m.,
in response to message #2 by Vieira, Luiz C. (Brazil)

Luiz, That worked fine except that the "New$kg=(value) is on the y line and the (value) is on x line ie x:(value). Thank you, It is not perfect but a lot better than I could manage by myself. Howard.

                  
Re: HP 42S Programming
Message #4 Posted by Vieira, Luiz C. (Brazil) on 8 Oct 2009, 11:21 a.m.,
in response to message #3 by Howard Jones

Hi, Howard;

please, make sure you did not add a 'new line' character after the "New$kg=", because it would cause the ALPHA cursor to 'jump' to the next line. I tested the lines I posted previously with my HP42S and the complete ALPHA contents used only the first, top line of the display (commonly filled with the Y-register contents, as you mentioned). I filled the X-register with as many digits as possible.

You mentioned you could do that with the HP41, right? The HP42S is not much different, though. The ALPHA register holds more digits and the LCD allows more digits to be shown in one single line, but these are advantages. Also, the ARCL X should read ARCL ST X (Stack register X) in the HP42S to avoid confusion with a possible ARCL "X" (variable named "X"), instead. So, the lines would read:

14 CLA
15 "NEW$KG="
16 ARCL ST X
17 AVIEW
Please, make sure there is no NL in the end of the ALPHA string in line #15 ("NEW$KG=NL")

Success!

Luiz (Brazil)


[ Return to Index | Top of Index ]

Go back to the main exhibit hall