Post Reply 
Splitting Lists on Prime G2 - Help Needed
03-02-2023, 11:37 PM
Post: #5
RE: Splitting Lists on Prime G2 - Help Needed
(03-02-2023 10:08 PM)PrimeG2_hp48sx Wrote:  Anyone else? Can it be done with a simple program?

Stack operations in RPN mode on the Prime are very limited and a program cannot manipulate the stack. However we can use some tricks to achieve "almost" what you need.

The following program assigns to the user key Shift Right_arrow a function which returns to the command line the different elements of the list in the stack level 1 (if there’s one), then pressing Enter will push these elements to the stack.

Code:
KEY KS_Right()
BEGIN
 IF TYPE(Ans(1))==6 AND Entry==2 THEN
  RETURN ΣLIST(EXECON("STRING(&1)+\" \"",Ans(1)));
 ELSE
  RETURN −1;
 END;
END;

Note: I’ve done limited testing so there may be some cases where it doesn’t work correctly.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Splitting Lists on Prime G2 - Help Needed - Didier Lachieze - 03-02-2023 11:37 PM



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