Further to Tim's comment I believe all of us have seen *strange* behaviour.
I guess the cause is editing any code after having run it, ie without
clearing the program buffer in memory.
In order to avoid such situations I proceed as follows
the config.pwf the development contains a COMMAND = DO ENV
After having run any code (prg/form/class/report, ..) I issue a DO ENV, then
modify the code and run it
I include the ENV below as an example. I guess that the interesting part are
the clear commands
In there is also a validate database which is run whenever the ENV is run.
I have lost a database a couple of years ago for it was beyond repair
Hope it helps
---------
#include ..\Base\Include\base.H
procedure env(___c)
=sys(3054,0)
on error
set path to ..\Base\Include
set procedure to ..\Base\Prog\Trigger, ..\Base\Prog\Utility,
.\prog\database, .\Prog\Moses
on error ??
=CloseDataBase()
release App
release all except pProfile
release pProfile
*_screen.cls
_screen.BackColor = rgb(255,255,255)
on error
do while ( txnlevel() > 0 )
rollback
enddo
local HadError, HaveDB
HaveDB = !dbused('Moses') and file('data\Moses.dbc')
Close All
set procedure to ..\Base\Prog\Trigger, ..\Base\Prog\Utility,
.\prog\database, .\Prog\Moses
if( HaveDB )
on error HadError = .T.
open data data\Moses exclusive
on error
if( !HadError )
set Data to Moses
validate database
pack database
endif
endif
close all
if ( pcount() > 0 )
clear all extended
compile Classlib ..\Base\lib\*.vcx
compile Classlib .\lib\*.vcx
compile Form ..\Base\form\*.scx
compile form form\*.scx
compile ..\Base\prog\*.prg
compile .\Prog\*.prg
compile report report\*.frx
*compile form Private\*.scx
*compile report Private\*.frx
endif
clear all extended
clear resources
release all extended
set sysmenus to default
set path to ;
..\Base\Prog, ;
..\Base\Lib, ;
..\Base\Include, ;
..\Base\Form, ;
Prog, ;
Form, ;
Report, ;
Private
set classlib to Control, ;
Applicat, ;
Form, ;
Default
set procedure to Utility, Moses
=Moses() && WHICH IS THE MAIN in this project
**
** Overrides Environment
set Escape On
set Notify On
set Safety On
set Talk On
set development on
********************
*
* set eventtracking prompt to file "Events"
**
* OR
* set EventList to Init, Destroy
* set DebugOut
return
endproc
------------------
"Fiona Cassidy" <fi...@tinet.ie> wrote in message
news:95ton8$ne5$1...@brimstone.medianet.ie...
| Hi,
|
| WE've had a problem on two different VFP 6.0 systems here recently,
whereby
| the code behind the command buttons on the forms have disappeared.
| VFP has been re-installed and the latest visual studio service packs are
| also installed. The only idea I have come up with, is that we may have
| opened the screens affected in VFP 5 at some stage. Would this have the
| effect of losing the code. When I look at the .SCT files through a text
| editor, the code still exists within these files, but is not avilable when
| you try accessing it through form design
|
| Has this happened to anyone else
|
|
| Thanks in advance for any replies
|
|
|
|
|
|
|
|