lundi 12 janvier 2015

Why is the Int32 sum always returning 0?


Vote count:

0




I know at least one value is not zero and sum is still always 0

Why?



get
{
Debug.WriteLine("ILockSumN");
Debug.WriteLine(iLocks[2, 1] == (Int32?)null ? 0 : (Int32)iLocks[2, 1]);
Debug.WriteLine(iLocks[3, 1] == (Int32?)null ? 0 : (Int32)iLocks[3, 1]);
Debug.WriteLine(iLocks[6, 1] == (Int32?)null ? 0 : (Int32)iLocks[6, 1]);
Int32 sum =
iLocks[1, 1] == (Int32?)null ? 0 : (Int32)iLocks[1, 1] +
iLocks[2, 1] == (Int32?)null ? 0 : (Int32)iLocks[2, 1] +
iLocks[3, 1] == (Int32?)null ? 0 : (Int32)iLocks[3, 1] +
iLocks[4, 1] == (Int32?)null ? 0 : (Int32)iLocks[4, 1] +
iLocks[5, 1] == (Int32?)null ? 0 : (Int32)iLocks[5, 1] +
iLocks[6, 1] == (Int32?)null ? 0 : (Int32)iLocks[6, 1];
Debug.WriteLine(sum);
return sum;
}


asked 37 secs ago

Blam

19.9k






Why is the Int32 sum always returning 0?

Aucun commentaire:

Enregistrer un commentaire