How to find the length (number of items) of a list

Started by RhesusMinus, August 10, 2011, 10:38:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RhesusMinus

Hi.

I can't seem to find out how I can find the number of items in a list via shape sheet formulas?

User.MyList = "100;200;300"

The User.MyList might be variable, so how can I find the number of items in this list?

LISTMEMBERCOUNT doesn't do the trick... Shouldn't there be a LISTCOUNT function? :)

THL

Jumpy

AFAIK there is no such function in the ShapeSheet-functions.
If your list is sorted ascending, maybe you can use a combination of:
Evaltext, Max, Lookup?

User.MyList = "1;2;3"
User.MaxFormula = "MAX(" & User.MyList & ")"
User.Max = Evaltext(User.MaxFormula)
User.ListCount = Lookup(User.Max,User.MyList) + 1

Don't know if this works, as I have no Visio at the moment.

RhesusMinus

I Guess this won't help, as my list consist of distances?

User.MyList = "10 mm;15.5 mm;20.5 mm"

THL

wapperdude

Why not make the list numeric only?  Then, either by formula or by format, let the "target" apply the units.  Makes managing the list simpler, lot less typing, etc.

Wapperdude
Visio 2019 Pro

Jumpy

Yes, that's what I sometimes do, too:

User.MyWidth = (PinX - LocPinX + 2 * Height) * 0.33
Width = User.MyWidth * 1 mm