04-13-2014 02:36 PM
Hi
I need a help in 2d array. Actually I have two 2D array with Input and Output..
I have to search element of Input and take index as refernce for output.
so result should be like this
INPUT OUTPUT
aaa ddd
bbb eee
ccc fff
thank you in advance
BR
Solved! Go to Solution.
04-13-2014 03:03 PM - edited 04-13-2014 03:05 PM
My first thought is "Why are you using 2D Arrays?" And then "Why so many loops?"
All you need a 1 FOR loop, a Search 1D Array, an Index Array, and a comparison to stop your FOR loop if you found a match. Autoindex on your Input and Output arrays. You then search for String on the input array. The Search 1D Array will output the index of the found item. Just use that to index out the Output you want. If a match was not found, -1 is the output. So when you have an index that is greater or equal to 0, stop your FOR loop. Output the result of the index array.