Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #13330
| From | "Wolfgang Riedmann" <wriedmann@gmail.com> |
|---|---|
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: help |
| Date | 2021-06-16 09:08 +0200 |
| Message-ID | <iitmbeFlndnU1@mid.individual.net> (permalink) |
| References | <4c7b6927-d9f3-45ec-8421-20f57891c17dn@googlegroups.com> <iiqq42F4kpbU1@mid.individual.net> <786e0eff-66b2-4531-9aff-01e5e16c7183n@googlegroups.com> |
Buon giorno Aurora,
the Destroy() method only cleans up ressources used by the window.
Therefore the DBF used by the subdatawindow may not be closed when the
Destroy() method of the owning DataDialog is called.
CollectForced() triggers a call of the garbage collector, and this call
cleans up all unused ressources, regardless where in the program they
were used.
The garbage collector in the VO runtime is a complicated but very
important piece of software, and for some more advanced tasks it is
important to understand how it works. I also had examples where a
CollectForced() call leaded to GPFs in the program, but that was always
the programmers ( = my ) fault.
Wolfgang
aurora baccio wrote:
> Il giorno martedì 15 giugno 2021 alle 06:54:27 UTC+2 Wolfgang
> Riedmann ha scritto:
> > Buon giorno Aurora,
> >
> > AFAIK you need to open a DBF in exclusive mode do execute the Zap()
> > method.
> > I suspect that there is another instance open that does not permit
> > to execute thzap operation.
> >
> > You should make sure that the SubDataWindow is closed and cleaned
> > up. More than using a :Destroy() call on it I would null it out
> > and issue a CollectForced() call.
> >
> > Wolfgang
> > aurora baccio wrote:
> >
> > > Good morning and good Sunday
> > > I cannot close an archive (ProvPres.dbf) .
> > > For other archives I use :
> > > oInError := InError{,false}
> > > .......
> > > oInError:Close()
> > >
> > > end of the procedure
> > >
> > > oIrror := InError{,false}
> > > oInError:Zap()
> > > oInError:Close()
> > >
> > > The Archive that I can't close feeds a subdatawindow contained in
> > > a datadialog and all the data that the user has to check arrives.
> > > If everything is correct it proceeds and then :
> > > oProvPres{}:Close() ......... .ProvPres := oProvPres{,false}
> > > oProvPres:Zap()
> > > oProvPres:Close()
> > >
> > > self:Destroy()
> > > I restart the activity assuming that the ProvPres.dbf archive has
> > > been reset. I notice that this procedure does not work, the
> > > archive remains open with the data of the previous operation. I
> > > ask for help. Thanks
> > > Aurora Baccio
> > --
>
> Good evening Mr. Riedman and welcome back.
> I am reasonably sure that the sub date is closed.
> At the end of the procedure I close with oProvPres:Close() the
> archive in question. After several attempts I inserted a close
> databases I didn't understand why, since all the archives had to be
> closed but since then the archive zap works. To be sure of what I do:
> oProvPres := ProvPres{,false}
> oProvPres:Zap()
> oProvPres:Close()
> from here on starts the whole procedure of building the recipe
> delivery. When the recipe is registered and archived
>
> I close the datadialog
> self:Destroy()
>
> I close the archive.
>
> oProvPres:Close()
> close databases
> CollectForced()
>
> From what I understand you suggest not to use destroy().
> How do I use collectForced ?
> Exactly I read that collectforced() skips the garbage collection but
> honestly I still don't understand why it didn't work before and now
> it does. I know one of the rules of computer science is to never ask
> why, but I remain curious. thanks Aurora Baccio
>
>
> Translated with www.DeepL.com/Translator (free version)
--
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Find similar | Unroll thread
help aurora baccio <aurorabaccio@gmail.com> - 2021-06-12 23:38 -0700
Re: help "Wolfgang Riedmann" <wriedmann@gmail.com> - 2021-06-15 06:54 +0200
Re: help aurora baccio <aurorabaccio@gmail.com> - 2021-06-15 12:06 -0700
Re: help JohnMartens <martens@tennishulp.info> - 2021-06-15 22:03 +0200
Re: help "Wolfgang Riedmann" <wriedmann@gmail.com> - 2021-06-16 09:08 +0200
csiph-web