Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Suppressing User Input
Message
 
 
À
24/11/2008 21:25:33
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01363890
Message ID:
01363892
Vues:
18
Do you want to prevent any use interaction during the process? If yes, Lock the keyboard.

>We have the following function, which in turn calls another function that does a lot of processing and socket communications. The issue is that while that is running a user can hit a hot-key (ON KEY LABEL assignment) or a shortcut key combination and interrupt the processing. We can't find anything that should allow this interrupt, as Foxpro is single threaded, but somehow it does. We thought by adding the PUSH KEY CLEAR to erase the hot-keys, and then using the CHRSAW() and INKEY to wipe out the buffer, we could eliminate the interrupts, but they still happen. Any ideas?
>
>
>
>*******************************************************************************************************
>FUNCTION SocketExport( m.loSocketObject, m.lcExportTo, m.lxExchangeType, m.lxArea, m.lxKeyValue, m.lxEvent )
>*******************************************************************************************************
>LOCAL m.lbSendEvent, m.lbSuccess
>
>	m.lbSendEvent = ( PARAMETERS() = 6 )
>
>	PUSH KEY CLEAR
>
>	m.lbSuccess = .F.
>
>	DO WHILE ! m.lbSuccess
>		IF m.lbSendEvent
>			m.lbSuccess = m.loSocketObject.ProcessData( m.lcExportTo, m.lxExchangeType, m.lxArea, m.lxKeyValue, m.lxEvent )
>		ELSE
>			m.lbSuccess = m.loSocketObject.ProcessData( m.lcExportTo, m.lxExchangeType, m.lxArea, m.lxKeyValue )
>		ENDIF
>		IF ! m.lbSuccess ;
>				AND ! RetryCancel( 'The following error was encountered while attempting ' + CHR(13) ;
>				+ 'to transmit data to ' + m.lcExportTo + ':' + CHR(13) + CHR(13) ;
>				+ m.loSocketObject.errorMsg, 'Data Transmission Error', '!' )
>			EXIT
>		ENDIF
>	ENDDO
>
>	DO WHILE CHRSAW()
>		INKEY()
>	ENDDO
>
>	POP KEY
>
>RETURN m.lbSuccess
>*******************************************************************************************************
>
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform