Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Releasing procedure
Message
From
22/09/2010 03:01:56
 
 
To
22/09/2010 02:50:14
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01482115
Message ID:
01482263
Views:
51
Exactly. As long as you have any reference to an object, you are not able to release it. Don't ask me why, but the gurus recommend to set the reference to .NULL. before releasing, like this
octrl=.NULL.
Release octrl
>I got it :)
>
>this was the code I use to create my Form :
>
>
>Scan for ordine > 0
>	oform.addObject('_l'+Transform(recno()),'Mylabel')
>	oCtrl = Evaluate("oform."+'_l'+Transform(Recno()))
>	oCtrl = Evaluate("oform."+'_l'+Transform(Recno()))
>	oCtrl.autosize = .t.
>	oCtrl.caption = Alltrim(wObjShow.descri)
>	octrl.left = 10
>	octrl.top = lnTop + 3
>	octrl.visible = .t.
>	lntop = octrl.top + octrl.height
>
>	oform.addObject('_'+Transform(Recno()), Iif(Empty(wObjShow.codice),Alltrim(wObjShow.ctrl),'p'+Alltrim(wObjShow.ctrl)))
>	oCtrl = Evaluate("oform."+'_'+Transform(Recno()))
>	oCtrl.width = 100
>	octrl.left = 10
>	octrl.top = lnTop 
>	octrl.visible = .t.
>	lntop = octrl.top + octrl.height
>*-------------
>* adding this line I haven't  errors anymore 
>	Release octrl
>*-------------
>EndScan 	
>
>
>Note that first of this step I cleared the oForm e oCtrl variables at the end of the program.
>I also tried with clearing explicity each of the "OnFly Classes" but I kept on getting the same error.
>Now it works !!
>
>thanks for your support :)
>
>>You can try to add
>>
>>CLEAR PROGRAM
>>CLEAR CLASS ...
>>
>>
>>In order to provide alternative you have to give more info on why you need to create a class on fly
>>
>>>I don't know why but I'm trying to define a class on the fly.
>>>To do that I put the code on in a string, transform this string in a file.prg than compile it and add it to my procedures
>>>
>>>
>>>lcString = myDefineCode
>>>=strtofile(lcstring,MyFlyProc,0)
>>>lcMemSet = set('procedures')
>>>compile MyFlyProc
>>>set procedure to MyFlyProc additive
>>>
>>>* excute my code which refers to defined object
>>>release procedure MyflyProc
>>>set procedure to (lcMemSet)
>>>*
>>>erase MyflyProc
>>>
>>>
>>>
>>>Well I cannot erase that file as it tells me that outstanding references exist. How can I kill those references
>>>
>>>Thank you
>>>Alessio
>>>
>>>By the way, if there are better methods to do that...fell free to suggest them to me :)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform