So make a two dimensional array. Each element of the main array is a sub-array of two numbers, x and y. The main array you make as large as needed to hold the number of data pairs your sketch needs to remember.
Google "Arduino two dimensional array"; this will turn up pages like this one: Arduino - Multi-Dimensional Arrays
Do some reading and implement this in your sketch.
You can loop through an array using a for-loop. You can have your sketch maintain an index variable that "remembers" the most recently written array element, for instance.
I think OP's saying that the y values are not known at compile time, and then there might be confusion about how to save the to-be-read-later y values somewhere and recover them sometime after the reading.
Does a set of data exist? Graph it for trends. I find it strange that this super-complex, mystery formula does not have a formula, or data, or a name. If nothing has an initial "x" and "y" is unknown and dependent on an arbitrary time of day:
Could be. It's hard to tell. Maybe some analysis is supposed to happen during the downloading? Or after all the data has been downloaded? And then an x occurs.
Okay... At 50 posts... so it's time to get creative. OP wants to play "my code is super top confidential so I will not release anything useful, but expect help".... I sum and present what I observe... Date and time effect output, and the input is unknown, so OP is running a card skimmer and is actively trying to extract card numbers from a rolling cypher. How close am I? RSVP with useful information, including data dump.
Its not worth to spend any more time on this.
The TO is not responding direct questions.
So it might not be important for him to get help.
Please just let this thread go down the history.
I think you have got to the crux of the problem Bob. I don't need to save x,y values to look them up later as you suggest. This is why I have not been responding to suggestions of an array. This would be wasting a lot of computer space.
The x variable is used to do something and the y another thing.
Then other values of x,y being different values will do something else.
Once the thing, whatever it is, is done it becomes historic with no need to be saved.
Having seen that description I don't see what the problem is. You receive x and y and use their values. Job done. Later you receive different values of x and y and use them instead. Where is the problem ?
the problem may be my revised coding Bob. which now is;
for (x=0; x< 100; x++){
y;
x;
}
In the 'for' statements you always get the x++ tacked on the end. This may not be necessary and may just not work.
I could try this;
for(x=0;x<100;{
y;
x;
}
x goes through the values of 0-100 in steps of one. y may be 5 when x is 55. x is tested and the 'for' statement is exited when x >=100.
However this may not be valid coding without x++.
That particular code will be a (perfectly valid) endless loop because x is set to 0 at the beginning, and is never changed. It will not go through the values 1-100 because it is never changed from zero.