I see this also. As others, for me it works fine in VFP8 but gives the behavior you describe in VFP7 and VFP6. About the only way I can get it to save is to close the Code Window with Ctrl+w, then reopen it.
Here is a repro for anyone interested:
1. Run this code:
LOCAL aobj[1], xx as form
DELETE FILE testxx.sc?
CREATE FORM testxx NOWAIT
=ASELOBJ(aobj,1)
xx = aobj[1]
xx.autocenter = .t.
xx.addobject('txt1','textbox')
xx.addobject('cmd1','commandbutton')
xx.cmd1.Top = 30
xx.cmd1.WriteMethod('click',[WAIT WINDOW 'Click' NOWAIT]+Chr(13)+Chr(10))
KEYBOARD 'Y' CLEAR
RELEASE WINDOW 'Form Designer - testxx.scx'
modify form testxx nowait method cmd1.click
keyboard '{ctrl+end}x = 1'+Chr(13)+Chr(10)
DOEVENTS
RETURN
2. Press ctrl+s
3. Type x = 2 on the line after x = 1
4. Press ctrl+s again.
Observed:
The x = 2 disappears.
If I try to force a save by changing the selection in the Code Window object dropdown or procedure dropdown, I get a 'File is not open' error. That error also occurs if you have saved with ctrl+s once, then try to save with ctrl+w
I guess you can always save by ctrl+w, or use VFP8 instead...
>OOPS! Correction - this behavior only happens in MODI FORM !!! NOT in MODI COMM. Still... any ideas?
>
>Sheepish Joe
Jim Saunders
Microsoft
This posting is provided “AS IS”, with no warranties, and confers no rights.