Is there any easiest way to declare multiple variables?

I need to create (declare) 100 and more variables in my app.
Every time creating and maintaining this much or more blocks is a hectic job.
Is there any easy way or solution to this? So that I can use a comma-separated string or something else to create multiple variables at a time.

Thank you.

@TheGenius, use the LIST for this purpose.
First, create an empty list.
Then add 100(or more) elements to that list using a for loop.
This works like an array of variables.

Try and feel the purpose.

Keep koding…
All the best.

1 Like

You could try using dynamic variables, to initialise a list of variables.

I will definitely try this. Thank you for your advice.

I am trying to figure out the process to use this extension. There is no demo block provided for a beginner like me.

But the method name or block name says it all. You can ask about the blocks that you do not understand in the community. And everyone learns by doing. And by doing it I mean, not always doing it right but making mistakes sometimes. For a beginner its bedt to learn new things but trying it out. If get stuck just search the community. Most probably you’ll find what you need. If not, just ask!!

the Dictionary is your choice

Kindly forgive me if I am wrong.

to use Dynamic Variables I need to create two separate lists.
That means this extension, itself is dependent on lists.
I can simply store the same data to a single list.
So what is the advantage of this extension over a list?

And as per my understanding, there is no block to store the data to a particular variable.
We need to change the data of a list and then the dynamic variable block can fetch this data.

Sorry again If I am wrong. Thank you.

I will look for this too. Thank you.

It is dynamically created variable. Thats the only advantage. For your problem this is not solution, but just an idea which might help you. Not a solution

Initialize
I think this might do the trick.

Instead of creating 100s of variables you can create a dictionary. Using dictionary will be much better because you shouldn’t have to initalize it with the different type of the variables(strings,numbers,lists etc.). So you can set any key’s value with any type of variable.
Calling the variable is also simple. You can get the value for any key using the simple dictionary get method.