Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Collection object
Message
From
07/09/2000 13:51:38
 
 
To
All
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Title:
Collection object
Miscellaneous
Thread ID:
00413706
Message ID:
00413706
Views:
45
Hi all,

I have a class (a collection) called files, each member is an object named file.

In another class, in class_initialize, i have:
Set mvarfiles = New files

In a method of that same class, I have:
mvarfiles.Add fileTag, FileName
mvarfiles(fileTag).someOtherFunction

When this method is called, I get an error: Invalid procedure call or argument. The error occurs on the someOtherFunction call.

someOtherFunction is a public function in the file class. If I replace
mvarfiles(fileTag).someOtherFunction
with
mvarfiles(1).someOtherFunction
someOtherFunction runs and there is no error. However, I would like to be able to acces the member of the collection by its fileTag, not its index. FileTag is a String.

I'm afraid the description of the problem is unclear. Should I be able to access a function within a collection member in this manner?

Thanks,
Steve Gibson
Next
Reply
Map
View

Click here to load this message in the networking platform