Logic Problem with array value assigning
-
Hello I am having two arrays of a object. I got fixed up in finding the solution for following problem. Array 1 holds value for the following cordinates 1 2 3 4 5 6 7 8 9 10 Array 2 can be any different situation, from above say like 1 2 3 4 5 6 7 8 9 In the object stored into the array element, there is one value "Height". Now i want to assign height in following fashion. This is done to make the previously assigned height in array1 to remain intact in a order of their coming in row. A1 -> A2 1 1 2 2 3 3 6 4 7 5 8 6 i.e. If any addition point is there in a row then leave that additional point like 4,5 in array1 and similarly if rows are more than also leave it. NOTE Both Array1 and Array2 are one dimensional array, but the logical position/location of values stored in it is like this. So this is to give an idea that with this type and any similar cases (where rows and points per row increases or decreases) , how the value is to be assigned. So main aim is to assign the array element shown in above and below example based on following mentioned logical positioning of the points. NOTE: Well number of rows and points per rows in both case is provided. Other example can be like this: Array 1 1 2 3 4 5 6 7 8 9 10 11 12 Array2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Assigning: A1 -> A2 1 1 2 2 3 3 4 4 5 6 6 7 7 8 8 9 9 11 10 12 11 13 12 14 How to do this? Am i clear in communicating the problem i am facing? _________________ Leave Your Mark Wherever You Go Leave your mark wherever you go
-
Hello I am having two arrays of a object. I got fixed up in finding the solution for following problem. Array 1 holds value for the following cordinates 1 2 3 4 5 6 7 8 9 10 Array 2 can be any different situation, from above say like 1 2 3 4 5 6 7 8 9 In the object stored into the array element, there is one value "Height". Now i want to assign height in following fashion. This is done to make the previously assigned height in array1 to remain intact in a order of their coming in row. A1 -> A2 1 1 2 2 3 3 6 4 7 5 8 6 i.e. If any addition point is there in a row then leave that additional point like 4,5 in array1 and similarly if rows are more than also leave it. NOTE Both Array1 and Array2 are one dimensional array, but the logical position/location of values stored in it is like this. So this is to give an idea that with this type and any similar cases (where rows and points per row increases or decreases) , how the value is to be assigned. So main aim is to assign the array element shown in above and below example based on following mentioned logical positioning of the points. NOTE: Well number of rows and points per rows in both case is provided. Other example can be like this: Array 1 1 2 3 4 5 6 7 8 9 10 11 12 Array2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Assigning: A1 -> A2 1 1 2 2 3 3 4 4 5 6 6 7 7 8 8 9 9 11 10 12 11 13 12 14 How to do this? Am i clear in communicating the problem i am facing? _________________ Leave Your Mark Wherever You Go Leave your mark wherever you go
Hello in short and sweet I am having a case like this: Design is having Number of rows and Points per row (This are editable) Well user set the values for Number of rows say 4 and points per row 10 then system will make 40 objects and will store them the CObArray mentioned above. Assigned with each object is an ObjectID say 0,1,2,....,39. So above is the case when user mention all of the data provided and system stores them to CObArray NOW if user changes the NUMBER OF ROWS or POINTS PER ROW or both. say 3 and 12 ,then system has to take it into consideration and has to restore the previous rowwise data back to the new one. That is main theme and based on this only is my above query. Sandeep Leave your mark wherever you go