Re: Proper Cleanup of Variables in VFP 6.0



NOTHING is VB-speak for NULL. It's not releasing the variable, it's setting
it to Nothing. When an object reference is set to null, the instance counter
for that object is decreased.

In VFP, variables get released automatically when they go out of scope,
although it's recommended to set object references to Null beforehand.

RELEASE actually gives memory back to the runtime engine, where NULLing a
variable keeps the memory occupied and just stores a different value to it.

Dan



Mike wrote:
> I'm developed .NET apps for the past 2 years and now I'm working with
> my first VFP6.0 application. In .NET, you can keep your programming
> 'clean' by setting the value of non-managed resources = NOTHING.
> I've noticed in VFP you can specify that your variables are
> 'released' by typing "RELEASE variablename". Are these two functions
> essentially the same? Or are they different?
>
> Thanks.


.



Relevant Pages

  • Re: Interaction with office programs
    ... > Release method for each interface obtained when you ... > Since Fujitsu COBOL does know that the object is an OLE object - it ... An object is released by setting another object reference (NULL object ... only for releasing) in the object reference data item.' ...
    (comp.lang.cobol)
  • Re: 2 newbie FP questions
    ... The reason VFP opted out of the Visual Studio package was that their ... developemnt cycle of new version was hampered. ... Microsoft continues releasing new versions. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Patience ! Codegear just needs some time to get their act together.
    ... releasing a VFP 10 and will be releasing the completed Sedna work on ... The components written as part of Sedna will be ... You can expect to see the Sedna code on CodePlex ...
    (borland.public.delphi.non-technical)
  • Re: handling fatal errors at run time
    ... You have no chance handling these ... vfp runtime module, so really vfp crashes. ... driver issues, printer driver issues, corrupt frx, dbf, dbc, ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Vfp 6 To vfp 8
    ... > I'm trying to convert my program from vfp 6 to vfp 8 but in some ... You could have a dangling ... object reference that you need to explicitly release. ... i x dot n e t c o m dot c o m ...
    (microsoft.public.fox.programmer.exchange)