Re: error closing method code window revisited (again :-)

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Ook (outlookexpress_at_nospam@embertsdotcom)
Date: 04/06/04


Date: Tue, 6 Apr 2004 15:32:19 -0600


"Olaf Doschke" <olaf.doschkeKEINESUELZE@t-online.de> wrote in message
news:c4v6ie$276$00$1@news.t-online.com...
> > Ahh, very interesting, I think this is the first report of it happening
in
> > VFP7 that I've heard.
> You can hear the second report of that happening by me, and
> I'm not the only one having seen it in VFP7.
>
> Corrupted VCX/SCX table? I think this is the major problem.
> You should pack all scx/vcx/frx of your project from time to
> time.
>
> I've done a projecthook that tries to make copies of the files
> you want to edit in the QueryModifyFile event. I save to a sub-
> folder, which is created if it doesn't exist.
>
> just a draft version of that event:
> Key parameter is oFile, the file-object is documented in help.
>
> => Files to copy:
> addbs(justpath(oFile.Name))+juststem(oFile.Name)+".*"
>
> =>Backup (destination) folder:
> addbs(justpath(oFile.Name))+"Backup"
>
> If copy file fails I show a warning messagebox. I get that mes-
> sage often, although no other of the normally known warnings
> and questions comes up and I could edit the choosen file if I
> wanted to...!!!
>
> So this way I know if there is some file handle on the files still
> open and a CLEAR ALL / RELEASE ALL often helps, although
> I definitely have not instanciated some class, perhaps just edited
> another one before.
>
> In addition to that helpful hint the projecthook saves the last ver-
> sion of the class/form/program before editing.
>
> One drawback: The QueryModifyFile event doesn't fire when
> using the command MODIFY ...
>
> I've not seen "error writing to file" for a long time.
>
> Bye, Olaf.
>
>

Corrupted scx/sct - maybe. If you have looked at how VFP stores method code,
non-object method code gets shoved in one field, and this field can become
huge if you have a large form with a lot of stuff. However, my favorite
theory is that VFP has it's own private data session that it uses for
opening forms and other things that are really just tables with different
extensions. I believe that there are bugs in the code that manages this data
session and the work areas, as that could cause the errors I and others have
seen. I've never once found any evidence of any corruption in any form that
this happens to.