I think those are easiest to understand by writing a demo script ( I modified For Each a bit to add idx, it might make it a bit easier to understand how it works)
Names Default To Here(1);
filepaths_to_open = {"$SAMPLE_DATA/Big Class.jmp", "$SAMPLE_DATA/Probe.jmp", "$SAMPLE_DATA/Iris.jmp"};
show(filepaths_to_open);
file_list = {};
show(file_list);
For Each({file_path, idx}, filepaths_to_open,
show(idx, file_path);
Insert Into(file_list, Open(file_path));
show(file_list);
);
- I use file_list to collect the references to the data tables which are opened (I don't need the filepaths as I already have them in the filepaths_to_open, but I don't have references)
- Open(file_path) will return a reference to the opened file and Insert Into will then add that reference to the file_list.
- The {filepath} comes from how For Each function should be used. Basically it will loop over filepaths_to_open and will return each element (one by one) in file_path variable.
filepaths_to_open = {"$SAMPLE_DATA/Big Class.jmp", "$SAMPLE_DATA/Probe.jmp", "$SAMPLE_DATA/Iris.jmp"};
file_list = {};
idx = 1;
file_path = "$SAMPLE_DATA/Big Class.jmp";
file_list = {DataTable("Big Class")};
idx = 2;
file_path = "$SAMPLE_DATA/Probe.jmp";
file_list = {DataTable("Big Class"), DataTable("Probe")};
idx = 3;
file_path = "$SAMPLE_DATA/Iris.jmp";
file_list = {DataTable("Big Class"), DataTable("Probe"), DataTable("Iris")};
Hopefully answer some of the questions.
-Jarmo