Message 1 of 3
Getting index of array

Not applicable
06-19-2002
03:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an array (single column) that can have up to 400 items in it. I want
to get to the specific index number for an item in the array without going
through a For loop (because it's taken FOREVER!); I already know the name of
the item I just need the corresponding index number.
I tried the following (n is a variant, CAP is one of the objects in the
array) but it doesn't work.
n = array("CAP")
Then I tried to create the array with a second column that is populated by
the index number. For example:
ELBOW, 0
FLANGE, 1
UNION, 2
CAP, 3
PUMP, 4
The code I used still doesn't give me the index number.
n = vvarray("CAP", 1)
If I know the object name why can't I get the associated index number??
Thanks,
--
--
Seth Cohen
Group Leader-Design Department
Mystaire Division
Misonix, Inc.
to get to the specific index number for an item in the array without going
through a For loop (because it's taken FOREVER!); I already know the name of
the item I just need the corresponding index number.
I tried the following (n is a variant, CAP is one of the objects in the
array) but it doesn't work.
n = array("CAP")
Then I tried to create the array with a second column that is populated by
the index number. For example:
ELBOW, 0
FLANGE, 1
UNION, 2
CAP, 3
PUMP, 4
The code I used still doesn't give me the index number.
n = vvarray("CAP", 1)
If I know the object name why can't I get the associated index number??
Thanks,
--
--
Seth Cohen
Group Leader-Design Department
Mystaire Division
Misonix, Inc.