Hi everybody,
I made an array of 10 objects of a class I've written, and I send one object of my array (array[index]) plus a string full of chars I received from the COM-port to a function, which cuts the string into pieces and puts those pieces into the array-object which means the members of my class. This works very fine.
I increment the index, the string gets filled again with the next data from the COM, and when I send the next object of my array (index is incremented!!) with the newly filled string to the function, the entries of my array-object on the first position got overwritten with the data of the new string, and on the next position (which should have been filled this time) appears the same data as on the first position. When I work out this process x times, my array contains x times the same (the last send in) data. How could I stop this and keep the old data??
I am very thankful for every kind of help,
linden99
I made an array of 10 objects of a class I've written, and I send one object of my array (array[index]) plus a string full of chars I received from the COM-port to a function, which cuts the string into pieces and puts those pieces into the array-object which means the members of my class. This works very fine.
I increment the index, the string gets filled again with the next data from the COM, and when I send the next object of my array (index is incremented!!) with the newly filled string to the function, the entries of my array-object on the first position got overwritten with the data of the new string, and on the next position (which should have been filled this time) appears the same data as on the first position. When I work out this process x times, my array contains x times the same (the last send in) data. How could I stop this and keep the old data??
I am very thankful for every kind of help,
linden99