I am working on a project where I have to create an array where the newest value will pop into the first element of the array and then shift the other values down by one.
This is the setup.
I have a string array[5,48] where [0,0],[1,0],[2,0][3,0],[4,0] are the first elements of each array.
Each array corresponds to a set of data from a different location so [0,0] corresponds to the temp in the garage [1,0] corresponds to the temp in the kitchen etc.
So once I have my string I use a technique that I found on this site.
I copy array[0,0] - > tmp_array[0,0] and then copy tmp_array[0,0] -> array[0,1] and then copy the data in using mid or copy Final_String -> array[0,0].
And then use that same logic for all of the arrays.
Now the logic works exactly the way that it is supposed to except for one routine ( I made each Stack Handler per say into its own routine) in that particular routine instead of moving array[3,0] -> tmp_array[3,0] it moves array[3,0] -> tmp_array[3,16]
and then tmp_array[3,16] -> array[3,17]
I have talked with many people and none have a clue as to why this is happening. I have deleted the routine to see if the value is still getting set ( to eliminate the possiblity of an outside routine modifying the values and this is not the case) and it isn't. So the issue is within the routine itsef and as of now there are 3 copies and one JSR
so
array[3,0] copy to -> tmp_array[3,0]
tmp_array[3,0] copy to -> tmp_array[3,1]
final_string copy to -> array[3,0]
If you have any insight as to why this copy is messing up please let me know this is driving me insane.
Thanks,
JustAGreenHorn
This is the setup.
I have a string array[5,48] where [0,0],[1,0],[2,0][3,0],[4,0] are the first elements of each array.
Each array corresponds to a set of data from a different location so [0,0] corresponds to the temp in the garage [1,0] corresponds to the temp in the kitchen etc.
So once I have my string I use a technique that I found on this site.
I copy array[0,0] - > tmp_array[0,0] and then copy tmp_array[0,0] -> array[0,1] and then copy the data in using mid or copy Final_String -> array[0,0].
And then use that same logic for all of the arrays.
Now the logic works exactly the way that it is supposed to except for one routine ( I made each Stack Handler per say into its own routine) in that particular routine instead of moving array[3,0] -> tmp_array[3,0] it moves array[3,0] -> tmp_array[3,16]
and then tmp_array[3,16] -> array[3,17]
I have talked with many people and none have a clue as to why this is happening. I have deleted the routine to see if the value is still getting set ( to eliminate the possiblity of an outside routine modifying the values and this is not the case) and it isn't. So the issue is within the routine itsef and as of now there are 3 copies and one JSR
so
array[3,0] copy to -> tmp_array[3,0]
tmp_array[3,0] copy to -> tmp_array[3,1]
final_string copy to -> array[3,0]
If you have any insight as to why this copy is messing up please let me know this is driving me insane.
Thanks,
JustAGreenHorn