Post Reply 
HP 48G - Edit List
08-22-2021, 03:02 PM
Post: #2
RE: HP 48G - Edit List
It's a bit unclear from your post whether you want to remove an object by its position or by its value but here are a couple of suggestions.

With the list on level 2 and the position on level 1:

Code:

\<< DUP2 1 SWAP 1 - SUB ROT ROT 1 + OVER SIZE SUB +
\>>

With the list on level 2 and the object to search for on level 1 as in your example, just a small addition to the program above:

Code:

\<< OVER SWAP POS DUP2 1 SWAP 1 - SUB ROT ROT 1 + OVER SIZE SUB +
\>>

As a side note, my opinion is that DEPTH is a command that should be used carefully if ever in programs. One basic principal of RPL programming is that a program should take a specific number of objects from the stack and not affect other objects that may be above them on the stack. The program fragment DEPTH \->LIST violates that principle by sweeping up everything on the stack regardless of its purpose or origin.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP 48G - Edit List - MNH - 08-22-2021, 03:40 AM
RE: HP 48G - Edit List - John Keith - 08-22-2021 03:02 PM
RE: HP 48G - Edit List - MNH - 08-23-2021, 12:02 AM
RE: HP 48G - Edit List - John Keith - 08-23-2021, 12:52 AM
RE: HP 48G - Edit List - DavidM - 08-23-2021, 03:13 AM
RE: HP 48G - Edit List - John Keith - 08-23-2021, 09:41 PM
RE: HP 48G - Edit List - John Keith - 08-23-2021, 01:13 AM



User(s) browsing this thread: 1 Guest(s)