I feel like this is a simple question, but I can't for the life of me get this to work.
The context is I have an XML extractor that frustratingly has to deal with n-tuples of mostly (aside from one row) redundant entries a couple levels into the structure. I'm trying to find those "duplicate" entries, and check if they are indeed duplicates before I import them into my larger table. I've got the checking the number of repeats down, but I'm having a horrible time getting my nested for/if loop to work. In fact, the loop consistently crashes the whole software if I have an Eval( Eval Expr(....Expr())) nested in the wrong place. I'm not sure why this is, and I'm wondering if I am just misunderstanding how to use that construction.
I suppose it may also be an issue with using char() and concatenate90 nested inside one another, though again, I'm not sure why that would be. The current code I have below crashes the software.
colnames = dt << Get Column Names( String );
show(colnames);
reps = 0;
show(reps);
For( i = 1, i <= N Items( colnames), i++,
reps = Sum( reps, Contains(colnames[i], "Data - Common Counting Time")); show(reps)
);
check = 0;
//Repeats that split columns
colnamecount = "Scan Append Number_4"; //Using a file that only has three of these columns, so show(colnamecount) = *_4 means its not going past that first if statment
If( reps> 1,
For( i = 2, i = reps, i++,
Eval(Eval Expr(colnamecount = Concat("Scan Append Number_", Char(Expr(i))))); //This is the issue
If(dt:{"Scan Append Number_1"}[1] == Column( colnamecount )[1],
check = check + 1,
check = check + 12
)
)
);
show(check);
The code doesn't work regardless, but until I can get that If statment comparing the column with the concatenated name to the first of the n-tupled columns, it doesn't matter, and first I need to get the concatenation to work and not crash jsl.
Anyone have any thoughts? Am I just being dumb with syntax?
Edward Hamer Chandler, Jr.