Error Messages/44455
Warning message
- The first parameter to Subset() has 2 dimensions and the «I» parameter is not specified; therefore, which index to operate over is ambiguous. You should fix this by specifying the «I» parameter with the index to take the subset over.
Description
Consider an array A
indexed by two indexes, I
and J
. You might see this error if you have:
Subset( A, resultIndex:K )
In this example, should Subset take the subset along I
or along J
? If it takes the subset along I
, it will return elements from the I
index, and will repeat this for each J
-slice. However, if it takes the subset along I
, it will return elements from the J
index, and will repeat this for each I
-slice, which is an entirely different result.
When you ignore this warning, it picks one arbitrarily. This puts you at risk for it doing something different than you intend. In fact, if you move objects around in your model, you may find that next time you load the model, it might pick the other index instead, so that your results mysteriously change.
There is really no reason you would ever want to NOT specify the «I» index when you know the array might have more than one parameter. If you can guarantee a 1-D array parameter in all future cases, then omitting «I» is fine.
Enable comment auto-refresher