Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Conditional logic problem
Message
From
07/08/2007 15:35:04
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Conditional logic problem
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01246593
Message ID:
01246593
Views:
69
I sort of asked this before, but not exactly for this situation. I need to know when a message has finished processing (populating a record in a table) to send an acknowledgement back through a port. I can be processing one or many messages in one bunch of text. This is just psudocode, so syntax is exceptionally lax... Thanks!
m.Successful = .F.

FOR ix = 1 TO NumberOfLinesInText

	m.Segment = GetSegmentHeader

	* Somewhere in here I need to know when one message ends and another begins to set m.Successful

	DO CASE
		CASE m.Segment = 'MSH'
			First Line of Message so Do Something
			APPEND BLANK
		CASE m.Segment = 'EVN'
			Next Line of Message so Do Something Else
			REPLACE MyTable.EVN WITH SomeStuff
	ENDCASE

	IF m.Successful

		* Send ACK back to HL7 Client
		m.Acknowledgement = "MSA|CA|123456789|Text Message|0001||"
		IF ThisForm.tcpServer.Object.State = 7
			ThisForm.tcpServer.Object.SendData(m.Acknowledgement)
		ELSE
			WAIT WINDOW "Not Connected." TIMEOUT 1
		ENDIF
	ELSE
		STRTOFILE("Message failed at: " + TRANSFORM(DATETIME()) + CHR(13),"C:\Errors.log",.T.)
	ENDIF
ENDFOR
Next
Reply
Map
View

Click here to load this message in the networking platform