02-23-2024, 04:47 PM
I seem to run into a problem every time I try to use lists and size, as they can unexpectedly turn into a list of lists instead, and I do not naturally get the way to work with them.
Lets say I have
LOCAL DI:=idivis(711000000);
PRINT (DI);
that prints "[1,2,3,4,5,6,8.........]" Those square brackets mean it is a matrix or vector, don't they?
In the manual idivis() says it returns a list.
So, If I then:
Print size(DI);
It returns {294}. - which means that idivis is returning a list of one containing a matrix/vector of length 294? Is there not a way to have it only return a list of 294?
It is quite confusing.
How can I then access the size of DI as a number - how do I get the result of size(DI) as a number, not a list/vector/matrix.
Lets say I have
LOCAL DI:=idivis(711000000);
PRINT (DI);
that prints "[1,2,3,4,5,6,8.........]" Those square brackets mean it is a matrix or vector, don't they?
In the manual idivis() says it returns a list.
So, If I then:
Print size(DI);
It returns {294}. - which means that idivis is returning a list of one containing a matrix/vector of length 294? Is there not a way to have it only return a list of 294?
It is quite confusing.
How can I then access the size of DI as a number - how do I get the result of size(DI) as a number, not a list/vector/matrix.