# Automatic variable naming

I am trying to construct a complicated code in which I need to name a lot of variables and their definitions.

For Example:

The problem is as follow:

Once I insert new variable in between two, I have to re-number the subscripts number in the SS & ss. Is there a way to make this automatic numbering?

Keeping in mind that if I re-execute the same part of code the numbering must be the same.

Subscripts are evil. Why don't you use an Association? This would get you rid of the whole numbering business. This could look like this:

value = Association[
"grav" -> 9.81,
"L" -> 100 10^6
];
help = Association[
"grav" -> "gravitational acc",
"L" -> "Length"
];


You need the value of "L"? Call value["L"]. You need help on "grav"? Call help["grav"]. You want to know which variable names you have? Execute Keys[value].

• The problem is, as the code get complicated the variables name get closer to each other. So, by calling ss_1 it will give the gravity with out the need of memorizing the actual variable spelling. – Love Eva Apr 15 '18 at 10:25