Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Process doesn't let me stop
Message
 
 
À
15/09/2001 07:53:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00556725
Message ID:
00556970
Vues:
15
Thanks, Gregory, I think, making it private would help. I'll check on Monday.
I do restore settings, I just didn't show the whole button code...

>Nadya,
>
>Just a thought.
>
>If llEsac is declared as local, then NamePrsr() will not see it
>
>private llEsc
>llEsc = .F. && the 'else' is not necessary
>
>Also watch out for .NiceEsc()
>
>It would be a good idea to catch the values for set('Escape') and on('Escape') at the beginning of the routine and restore them at the end
>
>>Hi everybody,
>>
>>I have the following code in form.button click:
>>
>>set escape on
>>on escape llEsc = .t.
>>oProgBar = newobject('ProgBar','progbar.vcx')
>>oProgBar.SetTitle('Calculating progress for Names parsing...')
>>oProgBar.SetMessage('File '+dbf('BldMstr')+ " "+transform(m.lnReccount)+" records")
>>oProgBar.SetRange(0, m.lnReccount)
>>oProgBar.show()
>>with thisform
>>	.lockscreen=.t.
>>	scan
>>		if m.llEsc and .NiceEsc()
>>			exit
>>		else
>>			llEsc = .f.
>>		endif
>>		lnCount=m.lnCount+1
>>
>>* -- Updating the percentage bar
>>		if mod(m.lnCount,100) = 0 && or (m.lnCount>=m.lnReccount-10)
>>			oProgBar.SetPos(m.lnCount)
>>			set message to '     Record #'+transform(m.lnCount) + m.lcMsgTail
>>		endif		
>>		owner1 = BldMstr.fullname1
>>		owner2 = BldMstr.fullname2
>>		ownrel = ""
>>		stateuse = BldMstr.stateuse
>>		Named = NamePrsr(@m.owner1, @m.owner2, @m.ownrel, m.stateuse, PROCESS_ENABLE)
>>		select BldMstr	&& In case we're in the wrong area
>>		if m.Named<>"F"
>>			lnTally =m.lnTally+1
>>		endif
>>		gather fields owner1, owner2, ownrel, Named memvar
>>	endscan
>>	set message to 'Process is complete...'
>>	if m.lnCount=m.lnReccount
>>		oProgBar.SetPos(m.lnReccount)
>>	endif
>>	.lockscreen=.f.
>>	oProgBar.release()
>>	oProgBar=.null.
>>	release oProgBar
>>....
>>NamePrsr is a quite long complicated program. I'm hitting ESC to terminate the process, but it doesn't want to terminate. Do you see a problem in the code above?
>>
>>Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform