Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Collection object
Message
De
07/09/2000 13:51:38
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
Collection object
Divers
Thread ID:
00413706
Message ID:
00413706
Vues:
44
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform