0

So I've created a class in boo that has three properties, Name as string, required as bool, read as bool.

Then Im going to create a method(SetDefault) that goes through the array of this type and sets all required properties back to true, and read back to false. Actually now that I think about it, Im not sure if it makes sense to have that as a method of the class. Doesn't matter.

Bottom line is Im declaring an array of this class type i've created.

testvar as (MyAttribute) = array(MyAttribute,10)

Once I've declared my array of this class, Im unable to reference any of the properties by using...

testvar(0).Name

The error is "It is not possible to invoke an expression of type (MyAttribute)"

I assume to use an array because they're all going to be the same data type. Is an array to correct type to use and if so what am I doing wrong?

scohe001
  • 15,110
  • 2
  • 31
  • 51

1 Answers1

1

Try using square brackets for array member access i.e. testvar[0].Name.

Martin Tapp
  • 3,106
  • 3
  • 32
  • 39