Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear Class Question

Status
Not open for further replies.

schafjoe

Programmer
Dec 16, 2002
20
0
0
US
Everybody,
I have the following sample code. Once the code is run, if I go into Windows Explorer and try to cut the “Template.Vcx” file and paste it to another directory, I get the following error: “Cannot Move Template: It is being used by another person or program.”
Can somebody tell me why it is still being used in memory?

*-- Class Library: C:\Test\Template.Vcx

DEFINE CLASS Template_Level1 AS CUSTOM
NAME = "Template_Level1"
PROCEDURE Process
*-- Some Code
ENDPROC
ENDDEFINE

DEFINE CLASS Template_Level2 AS Template_Level1
NAME = "Template_Level2"
ENDDEFINE

DEFINE CLASS Template_Level3 AS Template_Level2
NAME = "Template_Level3"
ENDDEFINE

oTest = NEWOBJECT(“Template_Level3”, “C:\Test\Template.Vcx”)
oTest.Process()
oTest = .NULL.

CLEAR CLASS Template_Level3
 
"Use RELEASE to remove the variable or array element from memory." - MSDN says on NEWOBJECT() function.

It seems like you just assigning your oTest mem. var. to a null releasing the object you've created from memory.

Consider RELEASE oTest instead.

IHTH.


Regards,

Ilya
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top