C
C#2y ago
Luppole

❔ Is there a way to name an object with an input?

up
6 Replies
phaseshift
phaseshift2y ago
wat
Pobiega
Pobiega2y ago
wat
Becquerel
Becquerel2y ago
please give an example of what you mean like
var name = "thing";
var blah = new name();
var name = "thing";
var blah = new name();
?
Denis
Denis2y ago
I believe they are asking whether it is programmatically possible to specify a variables name during runtime The answer is no I believe it might have been possible to do that in ActionScript, but don't quote me on that, I barely knew what I was doing when I was using it. If I understood your question correctly, what you need is a dictionary var dynamicValues = new Dictionary<string, object>(); You can add values that are associated with some name (key) to the dictionary as you please
Angius
Angius2y ago
Just make sure you use an actual proper type and not object
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server