Post Reply 
sysRPL - Last Element of a Composite
10-15-2024, 10:42 PM
Post: #1
sysRPL - Last Element of a Composite
Hello,

In sysRPL, ^LASTCOMP (2BC006) is said to return the last element of a composite.
For that purpose, this command executes DUPLENCOMP (3627A) then NTHCOMPDROP (35BC3).

Indeed, if I do (i.e.):
Code:
{ 1 2 3 5 7 } 
#3627Ah SYSEVAL          @  DUPLENCOMP
#35BC3h SYSEVAL          @  NTHCOMPDROP
I get 7 which is the expected result.

However, when I do:
Code:
{ 1 2 3 5 7 }
#2BC006h SYSEVAL         @  ^LASTCOMP
the calculator (HP 50G) freezes. (Fortunately, ON + C works without data loss! )

Is an argument missing? What am I doing wrong?

Thank you for any hint.
Find all posts by this user
Quote this message in a reply
10-15-2024, 11:03 PM
Post: #2
RE: sysRPL - Last Element of a Composite
(10-15-2024 10:42 PM)FLISZT Wrote:  Thank you for any hint.

^LASTCOMP is a FLASHPTR, indicated by the "^" as the first character of the ID. Instead of using SYSEVAL, you will need to use #2BC006h FLASHEVAL.
Find all posts by this user
Quote this message in a reply
10-15-2024, 11:23 PM
Post: #3
RE: sysRPL - Last Element of a Composite
(10-15-2024 11:03 PM)DavidM Wrote:  
(10-15-2024 10:42 PM)FLISZT Wrote:  Thank you for any hint.

^LASTCOMP is a FLASHPTR, indicated by the "^" as the first character of the ID. Instead of using SYSEVAL, you will need to use #2BC006h FLASHEVAL.

Thank you very much David! I did learn something.
Smile

Bruno
Sanyo CZ-0124 ⋅ TI-57 ⋅ HP-15C ⋅ Canon X-07 + XP-140 Monitor Card ⋅ HP-41CX ⋅ HP-28S ⋅ HP-50G ⋅ HP-50G
Find all posts by this user
Quote this message in a reply
10-16-2024, 11:45 AM
Post: #4
RE: sysRPL - Last Element of a Composite
You're welcome, Bruno!

SYSEVAL, FLASHEVAL and LIBEVAL all have their specific uses. I've seen many more instances of posts containing SYSEVALs, so it's easy to forget about the others.

When you see a "^" at the beginning of a routine name, it's almost certainly a FLASHPTR which would require FLASHEVAL. Likewise, a "~" would designate a ROMPTR requiring a LIBEVAL construct.

Standard disclaimer applies:

When using any of SYSEVAL, FLASHEVAL or LIBEVAL, be aware that any potential misapplication (including typos or simply incorrect usage) could lead to data loss. Best to try it out on an emulated system first.
Find all posts by this user
Quote this message in a reply
10-16-2024, 11:00 PM
Post: #5
RE: sysRPL - Last Element of a Composite
(10-15-2024 11:03 PM)DavidM Wrote:  
(10-15-2024 10:42 PM)FLISZT Wrote:  Thank you for any hint.

^LASTCOMP is a FLASHPTR, indicated by the "^" as the first character of the ID. Instead of using SYSEVAL, you will need to use #2BC006h FLASHEVAL.

^ for pointer as in Pascal AFAIK (I never practiced it).

In sysRPL, it's better not to skip pages, although it's tempting to do so, given their number! Wink

Thanks again David!

Bruno
Sanyo CZ-0124 ⋅ TI-57 ⋅ HP-15C ⋅ Canon X-07 + XP-140 Monitor Card ⋅ HP-41CX ⋅ HP-28S ⋅ HP-50G ⋅ HP-50G
Find all posts by this user
Quote this message in a reply
Post Reply 




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