I have created timeslots for patient scheduling. I have made 160 of them for one week but I want thousand weeks, so for every timeslot I have made a variable week (int). Now for some reason, every timeslot gets the value 1000 for the variable week. If I test the same code on a test variable it works just fine. Anyone has an idea?
int[] test = new int[160000];
for(int j =0;j<1000;j++)
{
for(int i = 0;i < 160;i++)
{
timeslot[j*160 + i] = timeslot_build[i];
timeslot[j*160 + i].set_week(j+1);
test[j*160 + i] = (j+1);
}
}
System.out.println(test[150]);
System.out.println(test[5166]);
System.out.println(test[44000]);
System.out.println(test[100000]);
System.out.println(timeslot[150].week);
System.out.println(timeslot[5166].week);
System.out.println(timeslot[44000].week);
System.out.println(timeslot[100000].week);
This is the output:
1 33 276 626 1000 1000 1000 1000
test?timeslot_build? Why do you assign twice the week value to timeslot(.set_week and .week)?