This all works fine, except I want to know if it was out of range in x or y, for example..
// Declaring the array
int[][] myArray;
myArray = new int[10][];
for (int i = 0; i < 10; i++)
{
myArray[i] = new int[10];
}
try{
if (myArray[x][y] != 0)
{
myFunction();
}
}
catch (IndexOutOfRangeException ex){
// Handle the exception
// Determine which of x and y was raised the exception
}
(that's just a quick example of my problem, not my actual code - I figured it may make it easier if it's more generic)
I'd appreciate any help whatsoever. Thanks, Reaper4334.

New Topic/Question
Reply




MultiQuote





|