Post Reply 
Accessing data in linked array on HP-50g
06-26-2021, 05:36 PM
Post: #4
RE: Accessing data in linked array on HP-50g
(06-26-2021 01:53 AM)Giuseppe Donnini Wrote:  At least on the HP-48GX, the following System RPL words work interchangeably with ordinary arrays and linked arrays.

GETATELN ( #0371Dh )
# arry --> ob TRUE
# lnkarry --> ob TRUE
# lnkarry --> FALSE
where # specifies a lexicographic element number for arry or a lexicographic pointer table entry number for lnkarry. For lnkarry, GETATELN returns FALSE if the specified element does not exist. Otherwise, it returns the specified element of arry or lnkarry and TRUE.
Note that FALSE is only returned for a null pointer within the limits of a linked array, so you have to make sure that # is within the range of arry or lnkarry. This can be checked with the following words:

DIMLIMITS ( #035A9h )
arry --> {}
lnkarry --> {}
Returns a list of binary integer objects representing the dimensionality of arry or lnkarry. The length of the list represents the dimension count and the internals are the dimension limits.

ARSIZE ( #03562h )
arry --> #
lnkarry --> #
For arry, ARSIZE returns the number of elements of the array in #. For lnkarry, it returns the number of pointer table entries of the linked array in #.
Dear Mr. Donnini,
Thank you very much for your response. My question with your answer is: How should I translate this into a working program? I am currently making a "pretty print" program for the HP-82240B Infrared printer. All data objects can be printed with this, including symbolics, as well as user and system RPL programs (the latter only in string form), in a clear layout that is very well-arranged, only linked arrays need to be added. So it's about extracting the various objects in the linked array one by one, and then printing them. Or unpack the linked array completely, as possible with a standard array, or list, after which all the objects are on the stack (hopefully). I hope to hear from you soon. Sincerely, Karel.

I use HP-16C, WP-34S emulator, HP-35s, HP-48GX, HP-50g, and HP Prime G2.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Accessing data in linked array on HP-50g - cahlucas - 06-26-2021 05:36 PM



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