hi
i make a class that name is time interval in my code i wanna add to object together
public double tosec()
{
double s;
s = (this.Days * 24 * 60 * 60) + (this.Hours * 60 * 60) + (this.Minuts * 60) + (this.Seconds);
return s;
}
public void addto(Timeinterval t)
{
double s1,s2,s3;
s1 = this.tosec();
s2 = t.tosec();
s3 = s1 + s2;
this = fromsec(s3);
}
i cant use last line because it says Cannot assign to '<this>' because it is read-only
thanks