The following warnings occurred:
Warning [2] Undefined array key 80313 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 80316 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 80319 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 80320 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 80323 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 80326 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 80336 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 80366 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 80319 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 80336 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 80366 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





HP-49G+ - Where is the "last x" key / function?



#4

Dear friends, I´ve just got a new 49G+ and realized it does not have the "last x" key / function. Is it true?

Regards, Miguel


#5

You are correct, there is no "Last X" key or function that replicates or closely mimics that function of the RPN calculators. You have to write a program to mimic the functionality. I have one which I am pretty sure was posted here (or perhaps at comp.sy.hp48) by James M. Prange. If you search the archives, you might find more information. The program I use is as follows:

<< DEPTH -> n
<< LASTARG DEPTH n - DUP -> s
<< ROLLD s 1 - DROPN DUP DROP
>>
>>
>>


Type the above in, and save to a variable named “LAST x”. The program seems to work fine.

#6

Dear Jeff, thank you very much for the program. I´ll try it right now!
Regards, Miguel

#7

Dear Jeff, I was thinking a litle more: why not use the "lastarg" function only, assigned to some key?

Regards, Miguel


#8

LastARG returns the last arguments! That may be more than just one.

Example: In approximate mode, 25 ENTER 6 divide.

LASTX would return a "6".

LASTARG returns 25 to the second level of the stack and 6 to the first level of the stack.


#9

Got it! Thank you! The program works, but for "33 alpha 'a1' sto>" , it returns a1.

Regards, Miguel


#10

That's because when you do ... 'a1' STORE the 'a1' is the last argument in the first level of the stack.

It is the "lastx".

Gene

#11

Thanks for the credit, Jeff. I may well have posted that program
somewhere, sometime, but it's not my preferred version. My only
problem with it is in the case of an empty last arguments buffer,
it errors out instead of returning 0.

Here are three programs that handle the empty last arguments
buffer case better.

Note that in the programs, I'm using exact integers (type 28) for
the 49 series. "Real" numbers (type 0) also work, but of course
the results from the BYTES command will be different.

This first one both returns 0. (as a real number) to the stack and
leaves it in the buffer if the last arguments buffer was empty.

%%HP: T(3)A(D)F(.);
@ Download (or enter) in exact mode on 49 series.
@ Results from the BYTES command:
@ 49 series checksum: # 2C67h
@ 49 series size: 69.
@ 48 series checksum: # ECA9h
@ 48 series size: 69
\<<
DEPTH \-> d
\<<
LASTARG DEPTH d -
IF
DUP
THEN
DUP2 2 + ROLLD DROPN
END
DUP DROP
\>>
\>>
This second one returns 0. (as a real number) to the stack and
leaves the buffer empty if the last arguments buffer was empty:
%%HP: T(3)A(D)F(.);
@ Download (or enter) in exact mode on 49 series.
@ Results from the BYTES command:
@ 49 series checksum: # B2D2h
@ 49 series size: 90.5
@ 48 series checksum: # F5Dh
@ 48 series size: 94.5
\<<
DEPTH \-> d
\<< LASTARG DEPTH d -
IF
DUP
THEN
DUP2 2 + ROLLD DROPN DUP DROP
ELSE
-55 DUP SF CF
END
\>>
\>>
This last one doesn't return anything to the stack and leaves the
buffer empty if the last arguments buffer was empty.
%%HP: T(3)A(D)F(.);
@ Download (or enter) in exact mode on 49 series.
@ Results from the BYTES command:
@ 49 series checksum: # 8C85h
@ 49 series size: 93.
@ 48 series checksum: # D527h
@ 48 series size: 97
\<<
DEPTH \-> d
\<< LASTARG DEPTH d -
IF
DUP
THEN
DUP2 2 + ROLLD DROPN DUP DROP
ELSE
DROP -55 DUP SF CF
END
\>>
\>>
If system flag -55 is set (No last args), then these programs will
error out.

Note that after some commands that don't take any arguments, like
CLEAR, DROP, and MEM, these programs don't return what was the
last object in level 1.

In the 49 series, LASTARG is invoked by LeftShift ANS (over the
ENTER key), at least in RPN mode. I've never used ALG mode, so
won't offer any advice for that.

For similar programs for the 28 series, change LASTARG to LAST,
and (in the last two programs) change -55 DUP SF CF to 31 DUP CF
SF.

Even in the 48 and 49 series, LAST can be used as a synonym for
LASTARG, to maintain backwards compatibility.

Personally, I prefer the first program that I've posted here best.

Just out of curiosity, which one do users of "Real RPN" models
prefer?

Regards,
James


Edited: 25 Oct 2005, 11:04 p.m.


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP50g: Writing a function that returns a function Chris de Castro 2 2,063 12-10-2013, 06:49 PM
Last Post: Han
  IFERR function on HP Prime Mic 2 1,779 12-02-2013, 01:33 AM
Last Post: cyrille de Brébisson
  HP Prime: Dirichlet's eta function recognized but not numerically evaluated Helge Gabert 0 1,123 11-16-2013, 03:41 PM
Last Post: Helge Gabert
  Possible bug with sqrt function in the HP prime Michael de Estrada 6 2,435 11-15-2013, 12:49 PM
Last Post: Michael de Estrada
  HP-41 MCODE: The Last Function - at last! Ángel Martin 0 1,020 11-08-2013, 05:11 AM
Last Post: Ángel Martin
  HP Prime - EEX/X/Toolbox-key suggestions bluesun08 2 1,488 11-07-2013, 06:15 PM
Last Post: bluesun08
  HP PRIME : strange behavior when trying user key capability Damien 12 3,802 11-03-2013, 11:02 AM
Last Post: Joe Horn
  HP Prime 'where' function bluesun08 11 3,280 10-29-2013, 06:56 PM
Last Post: Joe Horn
  HP PRIME: How to use [a b/c] key from a program Joseph Ec 4 1,853 10-29-2013, 06:18 PM
Last Post: Joseph Ec
  HP Prime - Defining a function bluesun08 5 2,244 10-23-2013, 02:43 PM
Last Post: Han

Forum Jump: