Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: jarnold30 on July 18, 2022, 05:58:51 pm

Title: iterating over a tagged value connector instance
Post by: jarnold30 on July 18, 2022, 05:58:51 pm
Hi, I have a stereotyped element with a tagged value connector.  That is, it has a tagged value which references a collection of elements.

I am trying to write a script which iterates over this collection, but it's failing with an error.

The code looks like this

1                  dim capabilities as EA.Collection
2                  capabilities = tag.Value
3                  for n=0 to capabilities.Count-1
4                     dim capability as EA.Element
5                     capability = capabilities.GetAt(n)
6                                                      <stuff>
7                  next

The error is 'Object Required' at line 3.

Any ideas?
Title: Re: iterating over a tagged value connector instance
Post by: qwerty on July 18, 2022, 06:44:27 pm
Not a VB guy, but try prepending set. VB is not a lnaguage, it's mumble.

q.
Title: Re: iterating over a tagged value connector instance
Post by: jarnold30 on July 18, 2022, 09:05:41 pm
doh!  If I had $1 for every time I made this error I'd be rich.  Thanks