Sorry to be tiresome but I’m still not “getting” it. I’ve spent dozens of hours on this, so some handholding would be greatly appreciated.
To summarize, I have a set of records with two key fields. I need to capture the current settings of these fields so I can later use the same table to impose the setting of the second field in each case where the first field occurs. The first field is text, the second is integer.
The two fields in the first four records read like this:
L1C1, 1
L1C2, 1
L1C4,
L1C1L2C1, 1
Several weeks ago Maarten gave me the following code for a two-dimensional array.
var a = new Array(4)
for (i=0; i < 4; i++)
{
a[i] = new Array(4)
for (j=0; j < 4; j++)
{
a[i][j] = "["+i+","+j+"]"
}
}
I’ve tried several variations to insert my two fields into this mill. Here’s my latest attempt (although I really feel I’m just flailing about). I’m missing something fundamental.
controller.setSelectedIndex(1);
var c = controller.getSelectedIndex();
var a = new Array(4);
for (i=0; i < 4; i++)
{
controller.setSelectedIndex(c++);
a[i] = new Array();
for (j=0; j < 1; j++)
{
a[i][j] = "[" + catkey + "," + tick + "]";
}
}
application.output('a = ' + a);
The above code produces this array:
a = [L1C1,1],[L1C2,1],[L1C4,],[L1C1L2C1,1]
This is the first variation that has produced something recognizable, although I’m not sure its form is the most useful for my purpose. See what I mean about being uncertain about what I’m doing?
Generally I can figure this stuff out after one or two prods. But not this time. I’ve reviewed various online JavaScript tutorials and am none the wiser. Sorry, but I’m currently too thick to get what’s going on here. The routine is very significant to my solution so I’m urgent to get this enigma resolved. Thanks.