Create multiple list from text string

You appear to be doing things in a very difficult way :wink:

Listview will show sublists with rounded brackets (...)

Give an example of what you expect your output list to look like.

Also, ensure in Screen1.properties in Designer that you have ShowlistsAsJson ticked.

Thank you for your help! I have already give the list I expected to get out of the procedure. I'll be very happy to have advise in this.

The reasen I try to do this is to lower memory space. I work with many lists in my app and get somtimes a compiler error

I possibly asked the wrong question then :wink:

What does your raw data look like? (your string - show it as text, not in a block) Where does it come from ?

Sorry I misunderdstood.. This is the string i want to convert. to the given list structure.

Woonkamerraam[Keukenraam[Slaapkamerraam[Behandelruimte[Tuin[Erfgrens[Terras|1.5[1.5[4.5[1.5[1.5[1.5[1.5

I made it myself with this conventions
|= 1level
[=2level
]=3level

Do the numbers relate to the words, e.g. Woonkamerraam & 1.5, Keukenraam & 1.5, etc...?

Yes you are right :grinning:

They are meters from the bottum

Then would it make more sense to create a list of lists like this?

[[Woonkamerraam, 1.5], [Keukenraam, 1.5]....]

Yes maybe but does this works to create a list with 6 levels. See example

Yes it can work.

Oke :grinning:I am glad to hear this. Witch tool should i use to do this. Also with split?

We start with where all your data is coming from, and in what format, and how it relates to each element.

Your "testList" is easy enough:

Woonkamerraam,Keukenraam,Slaapkamerraam,Behandelruimte,Tuin,Erfgrens,Terras,1.5,1.5,4.5,1.5,1.5,1.5,1.5

image

This looks very nice! But my app does read the format of my liststructure i realise. With your solution i haven reprogram it all. Isn't it possible to work with the component "add items to list" to create the structure I work with. And makes also list automatic with the given depht level?

I do not understand how your testlist relates to the big list of lists you presented earlier in the topic, or what exactly you want to do with it?

I use of each list the index and subindexes te get the information. The lists are leveled because the information belongs to each other. I use it for a noise calculation program.
The first code is nested and with an extension of three loops so I can make the big list I have shown (max 6 levels needed)). I have to extend the convention I have made also with 3. It works very wel accept it does make the rounded brakes around it because of the replace command I think.

This conventions I have made for 6 levels. I don't use comma's because I need them often
1: |
2: [
3: ]
4: {
5: }
6: /

Do you want to be able to generate that big list, LstGelBreTpeNorm from a text string ?

If so, can you either run Do it on the list in Companion, or set the list to a label, and copy the contents here, then we can look at how best to generate it.

yes that is the ultimate goal. I am open for a solution to do this. I appraciate your patience with me. Thank you

If you plan to show your code to other programmers and not annoy them, now would be a good time to learn about JSON.

www.json.org