Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code expansion error
Message
De
01/10/2012 19:51:36
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01554057
Message ID:
01554103
Vues:
37
>>>Hi Tommy,
>>>
>>>I see you already have your answer but, why isn't SocketWrench an Array, which would be much easier to handle?
>>
>>Can you educate me on this please? Considering that each SocketWrench appears to be an object on a page, how would you handle it as an array?
>>
>>.........Rich
>
>
>Hi Rich,
>
>Not sure what you see as a problem, maybe I am missing something?
>

Maybe I missed something < s >

Learned some new things from this today. Thanks





>The only issue I see is that you need to remember to clean up the array in the destroy if it is pointing to other objects, otherwise it is just another property of an object, a very crude sample, using empty object as the reference (warning, code like the one I am posting should never be used, as I am not declaring any variable, using hard-coded values where I shouldn't, no error handling etc, just trying to show that you can use the array):
>
>
>loForm		= CreateObject('myForm')
>
>for i = 1 to 18
>	? loForm.myPageFrame.Page1.SocketWrench[i].Name
>endfor
>	
>define class myForm as Form
>	add object myPageFrame as PageFrame
>	
>	function myPageFrame.init()
>		this.PageCount = 1
>		AddProperty(this.Page1, 'SocketWrench(1)')
>	endfunc
>	
>	function init()
>		dimension this.myPageFrame.Page1.SocketWrench(18)
>		for i = 1 to 18
>			this.myPageFrame.Page1.SocketWrench[i] = CreateObject('Empty')
>			AddProperty(this.myPageFrame.Page1.SocketWrench[i], 'Name')
>			this.myPageFrame.Page1.SocketWrench[i].Name = 'mySocketWrench' + Transform(i)
>		endfor
>	endfunc
>	
>	procedure Destroy()
>		for i = 1 to 18
>			? 'Destroying ' + this.myPageFrame.Page1.SocketWrench[i].name
>			this.myPageFrame.Page1.SocketWrench[i] = null
>		endfor
>	endproc
>enddefine
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform