Stewart Sweet

How to instantiate a List<object> in SRL

Discussion created by Stewart Sweet on Sep 20, 2012
Latest reply on Sep 21, 2012 by Tom Sheckells

Hello Everyone,

 

I am using the .NET version of Blaze and having some trouble instantiating a test object in SRL. I am using code like this in the initially section of a variable declaration:

 

Pretend myObjList is a List<MyObjListType> property on a .NET 3.5 object imported via Blaze's import wizard.

 

  myObjList = a List<MyObjListType>;

  myObjList[0] = a MyObjListType initially

  {

    value1 = "val1";

    value2 = "val2";

  }

 

 

When I run my project, it fails on myObjList[0] telling me the index is outside of the bounds of the List.

 

Any ideas are much appreciated :smileyhappy:

Outcomes