Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding objects to arrays with AddObject. Bug in VFP 9?
Message
De
20/06/2005 09:17:30
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Adding objects to arrays with AddObject. Bug in VFP 9?
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Network:
Novell 5.x
Database:
Visual FoxPro
Divers
Thread ID:
01024820
Message ID:
01024820
Vues:
68
We we have this base class that basically implements a collection. Part of the process is to add an object to an array. This code word flawlessly on VFP6 for years.
this.ItemCount = this.ItemCount + 1
Dimension this.Item[this.ItemCount]

Local cItemPlace
cItemPlace = "Item[" + LTrim(Str(this.ItemCount)) + "]"

this.AddObject(cItemPlace, this.ItemClassName, &tInitParameters)
We are now preparing to upgrade our systems to VFP 9 and during the testing we get an "Object name is invalid" error on the line that adds the object. This error occurs very rare (maybe once every 10000 times that line is executed). If you retry it runs! One of the times I've seen a very weird thing in the debuger. The debuger properly showed the array containing objects and what appeared to be an object named "Item[30]" residing on the same object the array is sitting on (the code errored when it tried to add the 30th element). You can drill through the object in the debugger, but when you try to reference it as this.item[30], the element of the array is returned.

Anyone ran into this?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform