$Some2DLongArray[$SomeIndex + 1, 0]
Method invocation failed for op_Addition because Object[] has no such method. Indeed, there is no operator that will add a single value to an array (from the left at least). But there shouldn't have been any object array involved here. Apparently PowerShell interprets the comma as delimiting elements of the array literal 1, 0 then tries to add that array to $SomeIndex. To get my expected interpretation of using $SomeIndex + 1 as the first dimension's index and 0 as the second's I had to enclose $SomeIndex + 1 in parentheses.
No comments:
Post a Comment