Why is my list empty outside of the creating event?

Hi, I create a List from a CSV to a table and split it into some more lists.
It seems to work fine but if I try to select an Item outsite of the File.GetText event I get an error that I try to select from an empty list.

It looks lite the list is just local in the event.
Also if it fill the List before with some items and then import the items from the CSV and check the length I have both, the one defined by hand and the imported one but again, outside of the event after import the CSV file I only has the handmade Items.

Can someone explain what happening here...

Order of things....

Put your Label1.Text block at the end of the File1.GotText block

Yes I know then it works but the Label is just for test.
I have to woke with the list outsite of the file.event

You will not be able to access your created lists until the File1.GotText block has finished.

But maybe you are right.
Maybe the File.GetText event fires or finishes after I try to read the list.

How can I check it or wait for it?

Set a label or a variable at the end. Then you can test for this when you run another event.

If you are automating, then use a clock timer to keep checking for the variable, then once it is set, it can run the event.

Don't display your chickens before they're hatched.


I was confused, you are right.
I tried to read the file and then go back to screen1.initalisation and do all the other stuff.
But of cause I can do this right after importing the file. Then I don't have to wait for the event.
It feels not perfect but it woks
keep it simple...