When a program is compiled, all of these strings of characters that we use to identify values that we are storing get changed to sequentially-generated IDs that only the machine can use.
So as your above code gets compiled, enough room for a double is eked out of memory, and given an ID that the compiler uses. Then, each time it comes to âaaâ in your code, and while the context establishes that those two letters should be interpreted as a variable name, the code is generated to go get the value from the location that the compiler has set aside for that variable. But the compiler does not call it âaa.â
In the case of short variable names, there is not musch difference either way, but with the fact that variable names can be 255 characters, it makes sense for the compiler to âtokenizeâ variables as part of the compilation process.
But due to this, there is no âaaâ for the program to find.
You can create a Collection, and name the items in it, and retrieve the value of those items through the string that is stored in your textbox.
I think what Gonzalo meant to say was â . . . put the variables in a class, make a property for each [u]variable in the</u> class, . . .â
But both of these methods requires that you know in advance how many variables you will be using, and what their names will be. (Well, actually you [u]could</u> dynamically load a Collection... A lot of work though.)
Brian
|