I have a script that automatically opens and concat's files that the user selects. basically, each file corresponds to a separate manufacturing batch. the user runs the script, a dialogue box shows up and the user selects all the files he/she wants to concat. originally, the list of available runs just came from a list of available files in the source folder. however, by default this orders the files based on alpha numeric name--which is not in anyway chronological. what i've decided to do is to instead have the list populate from a separate table with the batch IDs entered in chronological order. this didnt help as the string still comes out in alphanumeric order. I want the list box to preserve the order of the source table so i can quickly grab only the most recent runs, for example
if(
File Exists("M:\Data\prod_data.csv"),
Open("M:\Data\prod_data.csv"),
New Window("File Path Not Valid",
<< Modal,
V List Box(
Text Box ("File Not Found!")
)
)
);
Data Table( "prod_data" ) << Subset(
All rows,
columns( :Production ID ),
Output Table ("Batch List"),
);
Close (Data Table ("prod_data"), No Save);
////////////////////
Clear Symbols( UniqueRuns );
Summarize(UniqueRuns = by(:Name("Production ID")));
For( i = 1, i <= N Items( UniqueRuns ), i++,
UniqueRuns[i] = Regex( UniqueRuns[i], "offline_|.csv", "", GLOBALREPLACE )
New Window( "Select Runs", //creates a window from which users can select the runs they want to analyze by holding Ctrl or Shift
<<Modal,
V List Box(
Panel Box( "Batch Numbers Present on List", Runs_entry = List Box( UniqueRuns ) ),
BBox = Button Box( "OK",
SelectedRuns = Runs_entry << Get Selected;
BBox << Close Window;
)
)
);