Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conditional logic problem
Message
De
07/08/2007 15:35:04
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Conditional logic problem
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01246593
Message ID:
01246593
Vues:
70
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform