HP Forums

Full Version: Acces to a list
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

Need some help with my list.

L1 ={{1,2,3},{4,5,6},{8,9,1},{7,6,1}}

1. How to calculate the amount of elements (4)?
2. How to access every separate element of list L1

Thanks, for any help!

Cheers

Jan
1. SIZE
2. L1(<number>) to access further down inside, L1(<number>,<number>...) Ex: L1(2,3) returns 6 in your given list.
Hello,

Var[n] refers to:
if var is a list: the nth element of the list
if var is a string, the nth char of the string
if var is a vector, the nth element of the vector
if var is a matrix, the nth line of the matrix, or if n<0, the nth column
if var is an int, the nth bit of the int.

This works both in RCL and STO

var[n, m] refers to:
if var is a list: var[m] for the nth element of the list (parameter list can be up to 16 long!)
if var is a string, m chars starting at index n in the string
if var is a matrix, the element at pos n,mx
if var is an int, the m bit starting at pos n from the int

list(0):=val: adds at the end of the list

That should get you started.
Cyrille
Reference URL's