Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set talk window doesn't clear the screen
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Set talk window doesn't clear the screen
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01124376
Message ID:
01124376
Views:
46
Hi everybody,

I noticed this problem before. I think I even discussed it once with Tracy. Anyway, here it goes:

I'd like to show thermometer while doing selects. I'm using the following class:
**************************************************
*-- Class:        cussqlthermo
*-- ParentClass:  custom
*-- BaseClass:    custom
*---Created by:   Mike Yearwood
*-- Time Stamp:   10/18/05 09:07:11 PM
*
define class cussqlthermo as custom

*-- Holds SET TALK setting at initialization.
	protected icOldSetTalk
	icOldSetTalk = ""
*-- Holds SET NOTIFY setting at initialization.
	icOldSetNotify = ""
*-- Holds the output window at initialization.
	protected icOldOutputWindow
	icOldOutputWindow = ""
*-- Holds the name of the temporary output window.
	protected icNewOutputWindow
	icNewOutputWindow = ""
*----Holds Escape settings
	protected cOnEscape
	cOnEscape= ""
	protected cSetEscape
	cSetEscape = ""
	name = "cussqlthermo"

	procedure destroy
	set talk off
	local ;
		lcNewOutputWindow, ;
		lcOldOutputWindow, ;
		lcOldSetNotify, ;
		lcOldSetTalk, lcOnEscape, lcSetEscape

	with this
		lcNewOutputWindow = .icNewOutputWindow
		lcOldOutputWindow = .icOldOutputWindow
		lcOldSetNotify = .icOldSetNotify
		lcOldSetTalk = .icOldSetTalk
		lcOnEscape = .cOnEscape
		lcSetEscape = .cSetEscape
	endwith

	if version(5)>=700
		set notify &lcOldSetNotify
	endif

	set talk &lcOldOutputWindow

	release windows &lcNewOutputWindow

	set talk &lcOldSetTalk
* Now restore our settings
	on escape &lcOnEscape

	if m.lcSetEscape = "OFF"
		set escape off
	else
		set escape on
	endif

	endproc

	procedure init
*Class that activates SQL thermometer bar during init
*and restores altered settings during destroy.

	with this

		.icOldSetTalk = set("TALK")
		set talk off

		.icOldOutputWindow = set("TALK",1)

		.icNewOutputWindow = "SQLThermo" + sys(2015)
		.cOnEscape = on('ESCAPE')
		.cSetEscape = set('ESCAPE')

		set escape on
		on escape plStop = YesNo("Are you sure you want to stop?")

		local m.lcNewOutputWindow
		lcNewOutputWindow = .icNewOutputWindow
		define window &lcNewOutputWindow. from -1000,-1000 to -500,-500
		activate window &lcNewOutputWindow. in screen

		set talk window &lcNewOutputWindow
		if version(5)>=700
			.icOldSetNotify = set("NOTIFY")
			set notify on
		endif
	endwith

	set talk on

	return .t.
	endproc

enddefine
Now, the problem is that after I've done with select statement and display the messagebox (Selected nn accounts. Do you want to proceed?), the remains of the window are still on the screen.

I usually fix this problem using thisform.cls(), but why should I do so?

Do you see something I'm missing here?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform