Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Read events & Clear Events not working properly
Message
De
16/03/2006 07:13:18
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Read events & Clear Events not working properly
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01104834
Message ID:
01104834
Vues:
54
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)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform