DataTable and Nested Loop
I apologies if it appears as I am just asking for someone to give me the answer but to be honest I am.
I am trying to create a nested loop that references the Data Table but since my VB knowledge is virtual nil, I would really appreciate anyone’s assistance.
The scenario is as follows ...
I am doing some testing on whether a search for 2 railway stations goes to the correct page. I have all the stations listed in the DataTable under a heading "From". I have put the same list of stations in a column called "To". So at the moment both columns have the same data.
What I need to do is take the first station from the "From" column and then run through all the "To" stations but always using the same "From" station on each iteration. Once this has finished I need to use the 2nd station from the "From" column and do the same again. This needs to be repeated until I have cycled through all the stations in the "From" list.
I have been told that I should be looking to write a nested 'for' loop in the Expert view that calls DataTable methods to read the From column in the outer loop and then read each of the To column rows in the inner loop and advance a row each time in the outer loop. Then just add a line that compares the values read in the inner loop and to ignore them if they are the same (so you don't travel from London to London).
Obviously to the trained eye this would appear to be simple but to a VB ignoramus it is not.
Re: DataTable and Nested Loop
I think you need not go for coding.
Just you can put "From" in Global sheet and "To" in action sheet, and remember to set "run all iterations" for both Test (i-e Global sheet) and for Action.