Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form and Datasession problem
Message
De
31/03/2004 14:52:40
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
À
31/03/2004 13:14:51
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00891069
Message ID:
00891274
Vues:
29
Hi Mike,

That was it.

The good news is, without doing anything else, I put SET TALK OFF in the form's dataenvironment's BeforeOpenTables and no more "talking in the VFP SCREEN"!

The "bad" news is, I've already converted all my form scx's to classes (simple as opening the form and selecting Save as class...) to avoid the "talking".

I'm very glad that you found the root of the problem though. I'm going to keep that one for future reference :) I wonder if anyone else has seen this behavior?

Thanks again for "going the extra mile".

Regards,

Mike


>Hi Mike
>
>I did a test too. I don't like to leave a problem unresolved. Switching to class-based forms just to get around the problem is leaving the problem unresolved. ;)
>
>My test was to run DO JUNK from the command window.
>
>
JUNK.PRG
>ACTIVATE SCREEN
>CLEAR
>SET TALK ON
>SET NOTIFY ON
>SET STATUS BAR OFF
>PUBLIC oMyApp
>SET CLASSLIB TO myapp.VCX
>oMyApp = CREATEOBJECT("myapp")
>
>DO FORM junk1
>READ events
>CLEAR ALL
>
>Here's the form...
>
>
**************************************************
>*-- Form:         form1 (junk1.scx)
>*-- ParentClass:  form
>*-- BaseClass:    form
>*
>DEFINE CLASS form1 AS form
>
>
>	DataSession = 2
>	DoCreate = .T.
>	Caption = "Form1"
>	Name = "Form1"
>
>
>	ADD OBJECT command1 AS commandbutton WITH ;
>		Top = 84, ;
>		Left = 180, ;
>		Height = 27, ;
>		Width = 84, ;
>		Caption = "Color", ;
>		Name = "Command1"
>
>
>	ADD OBJECT command2 AS commandbutton WITH ;
>		Top = 84, ;
>		Left = 48, ;
>		Height = 27, ;
>		Width = 84, ;
>		Caption = "Quit", ;
>		Name = "Command2"
>
>
>	PROCEDURE Init
>		WAIT WINDOW "Form.Init"
>		FOR X = 1 TO 100
>		  A=M.X
>		ENDFOR
>		RETURN DODEFAULT()
>	ENDPROC
>
>
>	PROCEDURE command1.Init
>		WAIT WINDOW "Color button init"
>		FOR i = 1 TO 1000
>		NEXT I
>		RETURN DODEFAULT()
>	ENDPROC
>
>
>	PROCEDURE command1.Click
>		WAIT WINDOW SET("TALK")
>		oMyApp.SetFormColor(THISFORM)
>
>		WAIT WINDOW SET("TALK")
>		FOR I = 1 TO 100
>		  A=m.I
>		NEXT I
>	ENDPROC
>
>
>	PROCEDURE command2.Click
>		CLEAR EVENTS
>		THISFORM.Release()
>		RETURN .T.
>	ENDPROC
>
>
>ENDDEFINE
>*
>*-- EndDefine: form1
>**************************************************
>
>Here's my app object.
>
**************************************************
>*-- Class:        myapp (myapp.vcx)
>*-- ParentClass:  custom
>*-- BaseClass:    custom
>*
>DEFINE CLASS myapp AS custom
>
>
>	Name = "myapp"
>
>
>	PROCEDURE setformcolor
>		LPARAMETERS m.toForm
>		m.toForm.BackColor = RGB(255,255,255)
>	ENDPROC
>
>
>ENDDEFINE
>*
>*-- EndDefine: myapp
>**************************************************
>
>I added code like this to the form.dataenvironment OpenTables, BeforeOpenTables, and Init methods.
>
>
A=PROGRAM() + " Before SET TALK OFF" && SHOULD ECHO
>SET TALK OFF
>B=PROGRAM() + " After SET TALK OFF" && SHOULD NOT ECHO
>
>
>What you'll see is the earliest place to SET TALK OFF is in the data environment's OpenTables method. Put SET TALK OFF there. If it comes back, you'll have to start tracing. ;)
>
>HTH!
>
>
>>Just for "fun" I did a test. I saved my form as a class then instead of DO FORM..., I did myform = CREATEOBJECT("myformclass"). BAM! It works without any information echoing/talking on the VFP SCREEN.
>>
>>I had to put code into the form class Load() event to open my views since there is no form dataenvironment in the form class.
>>
>>Do you have any ideas as to why it works this way and not the other?
>>
>>Thanks for all the input.
>>
>>Regards,
>>
>>Mike
>>
>>>Is SET TALK OFF the first line in the form.load?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform