Methods for generating/storing a random number of variables?

I have a data set(wave), of random length. I want to generate variables (lets say anywhere from 3 to 10 of them) based on this length, for logical operations on my data. I realized pretty quickly that I couldn't use a for loop and create variable_i as i iterates thru the loop.

What I am doing now is just creating a new wave of the appropriate length and calling its point values as my variables, instead of creating actual variables. But so far I am forced to tack it onto a table and fill in the values, which seems cluttered (id prefer to have it run in the background, with GUI for input, instead of actually "seeing" the wave. )

I've tried running a set_variable GUI in a loop so that I fill in wave(i) points, but the program just hauls ass thru the loop, showing the GUI only once and I end up with a wave full of zeros and only the last point contains any user input. I was hoping more for a screen showing "i" set_variable GUIs so that I could set them all one by one. Putting a button in at the bottom so that the next function is called only after the user has input their values would be the next, and easy, step.

Or is there a more elegant solution?
How about something like this:

function gVars(varstring, wName)
    string varstring, wName
   
    Make/O/D/N=(ItemsInList(varstring)) $wName
    wave w = $wName
   
    w= str2num(StringFromList(p, varstring))
   
    // eventually use another string to put DimLabels on
    return 0
end


Then execute e.g.

gVars("1;3;5", "myGlobals")


You could execute this from the command line or enter the strings in a GUI.