change variable names in javascript

Hi I'm trying to change variable names (rather than the values) via js but I don't know the method for it.

Using the google doc with RMMV script calls I get this: $gameVariables.setValue(var, value); but nothing for how to change the name of the variable itself. Anyone know if this is possible?

Thanks
variable 001 = to a name?
as in the database you place name and you get variable 001 name = x?
or the value name as in script? $gameVariable.setValue(1, "name")
so it wont be a number?
Code:
$dataSystem.variables[variableId] = "insertname";
Probably works but they don't persist through saves though so you would have to call it again at load time.
variable 001 = to a name?
as in the database you place name and you get variable 001 name = x?
or the value name as in script? $gameVariable.setValue(1, "name")
so it wont be a number?

Thanks for your reply. Yes, I'm trying to change the Name in the database object. Like "variable 001 = to a name". I see that the names exist in csv form in the js system file so I figure there must be a way to change it via script. I'm procedurally generating a bunch of variables so the names will help me keep track of which variable is which.
The names for variables of the editor are not handled inside the engine itself, they are only handled on the editor for display.
you can probably edit that file to read and change it, but you'll have to write those functions on your own as nothing in the engine itself ever touches that file (not to my knowledge).
The names for variables of the editor are not handled inside the engine itself, they are only handled on the editor for display.
you can probably edit that file to read and change it, but you'll have to write those functions on your own as nothing in the engine itself ever touches that file (not to my knowledge).

Thank you!
You can also define variables like this
JavaScript:
$gameVariables.yourvariablename = 1967;
handles like normal javascript variables just with $gameVariables. before it (no need for setValue) and they will persist through saves.
You can also define variables like this
JavaScript:
$gameVariables.yourvariablename = 1967;
handles like normal javascript variables just with $gameVariables. before it (no need for setValue) and they will persist through saves.
Thanks a lot, that would be helpful I'll try that.
Just to be over explicit: that doesn't change the name of an existing gamevariable but adds a new variable to the gamevariable object with the given value. But I think you understood that! Just like normal javascript variables like I said :')

Original thread: https://forums.rpgmakerweb.com/threads/change-variable-names-in-javascript.120182/