Ask a Question

Use 'var' that contains array of elements in C# Code

Ivg
Occasional Contributor

Use 'var' that contains array of elements in C# Code

Hi,

 

I'm trying something like this:

 

var a = someProcess["FindAll"]("text", "Simulate", 200, false);
var b = a["0"];

 

In debug mode I can see that 'a' contains 2 COM objects, but on the second line it fails on 'MissingMethodException'.

I guess the problem is that my syntax is wrong.

 

How can I use it?

 

Thanks

1 REPLY 1
Colin_McCrae
Community Hero

Don't think the array index (0) should be in quotes?

 

Try:

 

var b = a[0];

 

... instead.

cancel
Showing results for 
Search instead for 
Did you mean: