Lists of lists help

Trying to figure how to use lists of lists from one variable.
Attached is what I have but cannot get it work, or ore aptly, don"t know how to make it work. Thanks in advance.

I want textBox1.text to be the name of the list in the list.

(spanish) explique que es lo que quiere hacer

muestra como "nace" la variable lists

Make like this :

blocks

Note :
So you only need to add again block (select list item) with the same index.

if you want to retrieve text from textbox2, you just need to change this index :

6ab2fd3dc3a4d42bd090f1818c51cc320c3ef31e

if u want select list of list, first: select list (1) then the list on the list: (1), there you are getting a list

Ha! It seems so simple.... thank you. I kept just trying to manipulate the index only to dig deeper. Never occurred to me to try that way.
Thank you very much folks!

You're welcome @Charley_Nelson :grin:
if your problem has been resolved please close this topic by pressing the solution button.

Regards,
Salman Dev

Not quite. I tried, but with both indices set at 1, I get a can't 1 of 0 error.

I got it. No errors.

1 Like

Okay, so if your problem is resolved I think you should close this topic, so other people who have problems like you don't need to create a new topic.. :grin: :+1:

Well, after messing around with my lists of lists, it still doesn't work. Even with your fix, I just get errors saying I can't get item 1 from a list of zero despite the list being filled.

(happens at a click of a command button)
Message received:
Runtime Error
Select list item: Attempt to get item number 1 of a list of length 0: []

By changing the index in the second [select list item] to 2, my label1.text will display text from textbox1.

What am I doing wrong?

Thanks

Include the rest of your app.
The error might have its origins elsewhere.

On further thought, you did not show how row 1 of the global variable lists received its value. That is the index where your error is happening.
We need to see everything that happened to global lists from init until the error.

Besides declaring the variable, that's it. 6 text boxes, a label, a command button and a list view. I start small,

In your example you are creating a list of lists, see the comment box (the extra set of square braces)

Therefore you need to select the inner list before setting the elements to a list

If you do not need this list of lists you can just do this with the blocks:

image

Post your .aia export file so others can reproduce your error.

There is nothing more to the file, save the declaration.

My aim is to create a list of project names, and within each project 5 entries. Start, end, task, date and material cost. There are typically multiple entries for each project.
It is just practise for me. Learning new capabilities of the inventor.

....which you did not show us.

I think the problem is when you save the data you press save but you don't fill in all the textboxes.

Or maybe you don't create a variable (list) like this :

blocks



This is the code in its entirety. Possibly I am not displaying the data correctly.
The first list is supposed to be the project name, textbox1.text, the rest of the boxes are data pertaining to the project.
I wish to make this work before coding the rest of the app, which eventually will be imported into a much larger project management application.

You have to replace it like this for it to work better
image

1 Like