Author Topic: iterating over a tagged value connector instance  (Read 1584 times)

jarnold30

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
iterating over a tagged value connector instance
« 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?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: iterating over a tagged value connector instance
« Reply #1 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.

jarnold30

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: iterating over a tagged value connector instance
« Reply #2 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