Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Release causing error
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01035234
Message ID:
01035612
Views:
16
Hi Chad, thanks for the clarification!

>David,
>
>You can't release properties of objects with the RELEASE command. Setting the property to null as you have done will release the object (assuming nothing else is holding a reference to it). So, what you have below is correct. Just delete the line that you have commented out.
>
>HTH,
>Chad
>
>>Hi all, I define a class below to do some basic directory management. The release line in the destroy method does not compile. Any idea? Thanks!
>>
>>define class CDir as custom
>>   hidden sDir
>>   hidden oShell
>>   sDir= ""
>>   oShell= .null.
>>   function init
>>      this.sDir= sys(5)+sys(2003)
>>      this.oShell= createobject('WScript.Shell')
>>   function destroy
>>      cd (this.sDir)
>>      && release this.oshell && Error: must be a variable or array
>>      this.oShell= .null.
>>   function MyDocuments
>>      cd (this.oShell.SpecialFolders("MyDocuments"))
>>enddef
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform