Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read events & Clear Events not working properly
Message
From
16/03/2006 07:13:18
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Read events & Clear Events not working properly
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01104834
Message ID:
01104834
Views:
56
I'm rather embarrassed about this, but here it is:
* program main
*

oAppMain = Newobject('AppMain','\develop\fleet\classlibs\fleetforms.vcx') 	

* AppMain is a Custom class
oAppMain.DoForm('Maintenance')    && Instantiate and show a form

Read Events

Clear all
Close all
Quit
The form's unload method calls oAppMain.RemoveFromStack(this)
* oAppMain.RemoveFromStack
Lparameters loObject                       && The closing form
Local lnPosition As Integer

If Type('loObject') = 'O' And Not Isnull(loObject)
	lnPosition = Ascan(This.aForms,loObject.Name)
	If lnPosition # 0
		Adel(This.aForms,lnPosition)
		Removeproperty(This,loObject.Name)

		If Alen(This.aForms) > 1
			Dimension This.aForms(Alen(This.aForms) - 1)
		Else
			This.aForms(1) = Null
		Endif
	Endif
Endif


If Not Isnull(This.aForms[1])
	For i = Alen(This.aForms) To 1 Step -1
		loForm = 'This.o' + This.aForms(i)

		If Not &loForm..Visible
			&loForm..Visible = .T.
		Endif

		&loForm..Activate
		Exit
	Endfor
Else
        * When no more windows are open
	Clear Events    && Line gets executed but events are still being read
Endif
Peter Pirker


Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?

(Woody Allen)
Next
Reply
Map
View

Click here to load this message in the networking platform