java - Saving previous value for later usage -
i want save value , use later calculate difference between prog , progalt.
int prog = (s3.getprogress()-90); int progold = 0; int = prog-progold;
then stuff happening. , after want save value of actual prog in progalt use in next round.
progold= prog;
logically "progalt = prog" useless, because progalt set 0. so, how initialize progalt once , use saved value?
int prevvalue = 0; while (somecondition) { int curvalue = ...; int deltavalue = curvalue - prevvalue; ... prevvalue = curvalue; }
Comments
Post a Comment