Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Suppressing User Input
Message
From
24/11/2008 21:25:33
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Suppressing User Input
Miscellaneous
Thread ID:
01363890
Message ID:
01363890
Views:
66
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
*******************************************************************************************************
Next
Reply
Map
View

Click here to load this message in the networking platform