Post Reply 
Accessing data in linked array on HP-50g
06-27-2021, 07:15 PM
Post: #6
RE: Accessing data in linked array on HP-50g
(06-27-2021 05:19 PM)Giuseppe Donnini Wrote:  How does your program handle such non-standard arrays? Did you make provisions for arrays of any type and dimensionality?

Dear Mr. Donnini,
My program handles as far as I can judge only 'regular' arrays and matrices, both 1 and 2 dimensional (see code). I'll get to work with your code, as far as I can translate the pointers to the HP-50g. This may take some time, so it may take a few days before I will respond. Sincerely, Karel.

Code:

::
DUPTYPEMATRIX?_      // Idenify Array or Matrix
ZEROZERO
{
 NULLLAM
 NULLLAM
 NULLLAM
}
BIND                         // Make local vars
3GETLAM
ITE                            // Specify: Array or Matrix
"Matrix of:"
"Array of:"
PTR 2F127                 // Print string
DROP
FPTR 6 17C               // Explode Array or matrix
::
  INNERCOMP
  #2=                       // Check dimension
  case
  ::                           // If 2 dimensional
    COERCE2
    2DUP
    1PUTLAM
    2PUTLAM
    #*
    reversym
    DROP
    2GETLAM
    #1+_ONE_DO
    3GETLAM
    ITE                       // Start of sub-matrix
    "Submatrix "
    "Subarray "
    INDEX@               // Insert counter
    #>$
    &$
    CHR_:
    >T$
    PTR 2F127           // Print message
    DROP
    1GETLAM
    ZERO_DO
    DO>STR
    PTR 2F127           // Print Array part
    DROP
    LOOP
    LOOP
  ;
  COERCE                // If 1 dimensional
  #1+_ONE_DO
  ISTOP@
  INDEX@#-
  ROLL
  DO>STR
  PTR 2F127             // Print array part
  DROP
  LOOP
 ;
 "End of  "               // Indicate: end of array or matrix
 3GETLAM
 ITE
 "Matrix."
 "Array."
 &$
 PTR 2F127             // Print message
 DROP
ABND
;                            // End code
@
[/code]

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-27-2021 07:15 PM



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