Not first, all the variables only in the array.
Say you have the variables .. (that you would make into globals)
You can make it yourself easy, if you want to. Make a new event sheet. Call it "Indexes". (dont even need to include it)
In that new event sheet "Indexes" add the following globals.
global var1 (number) = 0
global var2 (number) = 1
global var3 (number) = 2
Now storing a variable to the array (if the array is big enough) goes like this.
Array > action > Set at X > ... index= var1 (the global in the other sheet) ... value = what you wanna store
To use a value in the array, use its expression
value = Array.at(var1)
Now you can sort as i showed you.