Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CTRL+S unreliable
Message
From
29/11/2006 01:16:06
 
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01172633
Message ID:
01173132
Views:
19
Peter,

I'll check it out. If it's an issue I'll try to get some attention to it.


>John,
>
>What I experience: A form has an editbox. The KeyPress event handles CTRL+S. It should save the edited text. What I notice is that this is normally not done in my case. It is done, however, when the debugger is actively involved (stepping in the code)!
>
>This code should prove my point.
>
>
PUBLIC ofrmeditcfp
>
>strtofile( "some text", "testfile.txt" )
>
>ofrmeditcfp=createOBJECT("frmeditcfp", "testfile.txt")
>ofrmeditcfp.Show
>
>modi file "testfile.txt"
>RETURN
>
>DEFINE CLASS frmeditcfp AS form
>
>
>	Height = 204
>	Width = 454
>	ShowWindow = 1
>	DoCreate = .T.
>	AutoCenter = .T.
>	Caption = "Edit MPS-configuratiebestand"
>	MinButton = .F.
>	KeyPreview = .T.
>	WindowType = 1
>	*-- Name of configFP.
>	cCFP = ('')
>	*-- Drive+Dir+Filename of configFP.
>	cDDF = ('')
>	*-- Old text of ConfigFP.
>	cOldCFP = ('')
>	Name = "frmEditCFP"
>
>	ADD OBJECT edtcfp AS editbox WITH ;
>		FontName = "Courier New", ;
>		Height = 204, ;
>		Left = 0, ;
>		Top = 0, ;
>		Width = 456, ;
>		ControlSource = "thisform.cCFP", ;
>		Name = "edtCFP"
>
>	PROCEDURE Resize
>		with thisform
>			.edtCFP.width  = .width
>			.edtCFP.height = .height
>		endwith
>	ENDPROC
>
>	PROCEDURE Init
>		lparameter tcDDF
>
>		local array laF[1,5]
>
>		with thisform
>			.cDDF    = m.tcDDF
>			.cCFP    = filetostr( .cDDF )
>			.cOldCFP = .cCFP
>			.caption = 'Edit ' + .cDDF
>			*
>			if adir( laF, .cDDF ) = 0 ;
>			or 'R' $ laF[ 1, 5 ] ;
>			or 'D' $ laF[ 1, 5 ]
>				*
>				.caption = .caption + ' (ReadOnly)'
>				.edtCFP.readonly = .T.
>			endif
>		endwith
>	ENDPROC
>
>	PROCEDURE KeyPress
>		LPARAMETERS nKeyCode, nShiftAltCtrl
>
>		with thisform
>			do case
>			case nKeyCode = 27
>				if not ( .cCFP == .cOldCFP )
>					if messagebox( "Discard changes?", 4+32, "Abort" ) = 7	&& if no
>						nodefault
>						return
>					endif
>				endif
>				nodefault
>				thisform.cDDF = ''
>				thisform.release()
>			case inlist( nKeyCode, 23, 19 )		&& ctrl+w, ctrl+s
>				nodefault
>				thisform.release()
>			endcase
>		endwith
>	ENDPROC
>
>	PROCEDURE Unload
>		with thisform
>			if not empty( .cDDF ) and not ( .cCFP == .cOldCFP )
>				strtofile( .cCFP, .cDDF, 0 )
>			endif
>		endwith
>	ENDPROC
>ENDDEFINE
>
>
>>I dispute that there is a problem here except when using that line of code. When using:
>>
>>x=0
>>DO WHILE x # 27
>> x=INKEY(0)
>> ?X
>>ENDDO
>>
>>Each CTRL+S is reported accurately.
>>
>>
>>>Aleksey,
>>>
>>>This is about CTRL+S.
>>>
>>>Walter Meester has been urging you to attent his problem. See BUG: CTRL+S misbehaviour Thread #1121615 Message #1121615. You have not participated in that thread.
>>>
>>>Other threads here, that go back several years, also indicate that someting is wrong with CTRL+S. Here is a piece of code:
>>>
>>>
? inkey(0),"<",inkey(0),"<",inkey(0),"<",inkey(0),"<"
>>>
>>>What I experience is that the first press of CTRL+S gives no reaction on screen, the second press shows TWO times the inkey value 19, the third press shows no reaction and the fourth press again shows TWO times the inkey value 19.
>>>
>>>Can you explain this?
>>>
>>>The deeper problem is that CTRL+S is reportedly terribly unreliable as a Save key combination.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Reply
Map
View

Click here to load this message in the networking platform