Good Afternoon:
First, thanks to all that responded. I appreciate all the input.
Christof, thanks for such a complete explanation.
I have excluded all VFP extensions from the antivirus software (Sophos)
And I will not compile an app in the same session as program/form 
modifications. I did write a quick prg to open all scx files and replace all 
objcode with "" before compiling for this converted VFP8 app.
And I have checked and changed your other suggestions as well. Like set the 
compile on exit to on.
The funny thing about all of this is that applications I have developed in VFP9 
do not lose code. It is only the ones that were developed on VFP8 where this 
issue exists. And not sure about the large app in VFP6 until I convert it later 
this year. I wrote a very extensive contact manager in VFP9 complete with email 
capabilities for my weekly salmon fly mailing. No code loss has ever been noted 
there and I make changes all the time. I also wrote several video remote 
control apps that runs across the Internet with our AHL team in Albany and have 
noticed zero dropped code in that one as well.
I will follow the recommended procedures with all my app from now on as a 
just-in-case scenario.
Thanks again!
Best regards,

Jack


Jack Skelley
Senior Director, Programming/Computer Operations
New Jersey Devils
(973)757-6164
[email protected] ________________________________________
From: [email protected] [[email protected]] on behalf of 
Christof Wollenhaupt [[email protected]]
Sent: Monday, March 26, 2012 1:39 PM
To: [email protected]
Subject: Re: VFP9: Method Code Disappearing...

>
> b) I have not noticed any files crashing when the form is saved and have
> not noticed any formname.tmp files in the project folder
>

It's actually a SYS(3) value, not the real form name (12345678.TMP).


> c) Very interesting. So what you are saying is that any VFP file that has
> code should be excluded from the virus scanner. These files would include
> scx, sct, prg, frx, frt, frx, vct, and vcx
>

It's surely a good idea, although SCT files are especially vulnerable as
they are also used as "Windows Script Components" which is part of Windows
Scripting Host. The technology isn't used much anymore, but virus scanner
still filter those file types.


> e) I guess this would explain Dave's solution to the missing code; the
> compile command rebuilds the objcode from the methods field. But I guess it
> does not explain why the 2 fields are out of sync when I compile the
> project into an exe when the checkbox for 'Compile all files' is checked.
>

I don't know why this particular problem is happening to you. A few random
thoughts:

- I personally never had a problem with VCX/SCX files and "recompile all",
but I never recompiled PRG files successfully if dependencies changed. VFP
would ignore the recompile all switch. Changing the PRG file triggers a
recompilation, changing an include file does not.

- Object code contains a time stamp that is used to determine whether code
needs to change, or not. I found this to cause problem on the FAT file
system (due to the 2 second precision) and on network shares due to
differences between time zones.

- Include files can impact they way a project is build, especially with the
combination of search paths and nested include files.

- VFP is using a mix of CRLF and LF for line feeds. This may cause offset
issues. I've never found this in any way to be connected with code loss,
but I can imagine that a strange combination of converted forms and code
page settings might trigger the internal translation of memo fields thereby
moving the beginning of the procedures by one byte per line. The database
engine in VFP is still cross-platform and performs various types of
translations.

- There are many settings that can have weird effects. SET DEVELOPMENT and
SET COMPATIBLE come to my mind.

- Using integrated source control makes all files read-only. Compiling a
file during the build project process therefore forces VFP to temporarily
remove the read-only flag. This might be picked up by virus scanners as a
suspicious activity. Admittedly, it never has been a problem for me.


> Also, as a carry over from other versions of dBase, foxbase, FoxPro DOS,
> FoxPro Windows and now VFP I use  ctrl W to save the changes and exit the
> form/report/prg. What is your opinion of this?
>

I haven't found this to be a problem. Although, I only started doing so in
the past two years since it's basically the same shortcut that is used on
the Mac (Cmd+W). I'm not consist, though. Sometimes I press Ctrl+Enter,
sometimes Ctrl+F4, sometimes Ctrl+W.


> So let me ask the question...what is your procedure to save any file that
> has code associated with it?
>

I don't do any special when saving code. I guess like everyone else I
frequently issue CLEAR ALL, RELEASE ALL, etc. I never run the application
in the same instance in which I'm writing the code which prevents all kind
of caching issues that could lead to code loss, though. Either I'm running
just individual classes, forms or unit tests or I'm launching a second
instance of VFP to test the entire app. A colleague wrote a program years
ago that would build the EXE and launch VFP.

One setting that I make my default, but many other developers seem not to
is the compile when saving switch in the editor settings in VFP. I always
want to know problems as early as possible. In the same area is the "make a
backup" setting which I turn off. I don't like my project directory to be
cluttered with BAK files.

Aside from that I'm mostly using source control which forces me to
frequently check my code for changes and provides a backup of my code. I
guess that gives a peace of mind not to worry about losing code as I'd
never loose more than the last few changes. A number of my projects use
automated builds. The actual EXE is not build from the source in my
development directory, but from a separate build directory that is
populated from the source code repository. Again, this insulates me from
changes the VFP IDE might make to files during the build process.

One thing I avoid is directly working on a network share. But you said
already that your files are local, so that's not the issue for you.


> Thanks for a tremendous insight to the situation.
>

I'd rather called it "How I lost my source code over the years" <g>

Christof

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/7d9e7f72b813014c8fd022cf04f820ed139...@ex08.drdad.thenewarkarena.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to