Can we have a GlobalVariableIndex function?

 
The only ways to get some "directory" of names and indices of globalvars is to call

string GlobalVariableName(int index)
and check the names that it is returning until it fits.

The other thing is if one calls

int GlobalVariablesTotal()

before every creation of a global variable and save the new index with the new name somewhere. So to have a full directory of all current global variables one could as well create the whole catalogue to begin with. 

It feels kind of arbitrary when multiple programs produce these arrays simultaneously...?

When dealing with the problem of returning an index the best solution seems to create names which begin with gvar followed by a separator and the index number...

BUT: since the terminal already has knowledge of their names and indizes, wouldn't it be practical to have a function

int GlobalVariableIndex(string name)  ?
 

Maybe I'm missing something in your question, but why would you want to know the index of a Global Terminal Variable if you already have it's name?

If you have its name then you can get or set it. There is no need to know its index (which can change at any moment at given moment).

Can you give a more concrete example of why you would want to find the index for a given name?

 
BUT: since the terminal already has knowledge of their names and indizes, wouldn't it be practical to have a function

What prevents you from writing this function yourself?

 
Carl Schreiber #:

What prevents you from writing this function yourself?

Yes, I will make it per EA or so with a string array of names just without putting the index in the  global variable names.
 
Fernando Carreiro #:

If you have its name then you can get or set it. There is no need to know its index (which can change at any moment at given moment).

You are right and that is the ultimate argument against it. I got so wound up in thinking how to make the class maximally practical that I overlooked this simple fact.