View Single Post
Old 02-06-2005, 08:55 AM   #7 (permalink)
ManWithAPlan
Addict
 
Location: M[ass]achusetts
ProductCatalog[productSpecifications = null] <-- that is your code right?
if so, why are you setting productSpecifications to null in the indexer?

otherwise, outofbounds usually means something like this...

string[] mystringarray = new string[3]

^^ that array will have 4 valid objects...
mystringarray[0]
mystringarray[1]
mystringarray[2]
mystringarray[3]

but if you do mystringarray[4], that's out of bounds. so you just have to make sure that the variable you use to retrieve an index of an array is within the bounds of the array.

to see how big an array is use the 'length' variable
Code:
int length = mystringarray.length
__________________
In the end we are but wisps
ManWithAPlan is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46