>>>>>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!
>>>>>
>>>>>
>>>>
>>>>What do you mean by
a message has finished processing (populating a record in a table)?
>>>>
>>>>You may have some trigger in the table...
>>>
>>>Just think of a big bunch of text with "MSH" and "EVN" imbedded at the beginning of lines. MSH means the first line of a message and a new record is appended. EVN (and any other following headers) mean that information needs to be populated into the new record. I do not have the luxary of putting triggers on this table, so it needs to be done in the code. When a message has finished I need to be able to say, "Cool, it finished. Let's send something back telling the sender it went well." Then onto the next message in the big bunch of text.
>>
>>It is still not exactly clear, but if you follow up my previous suggestion with using a special class to deal with your task, you may have a method ProcessMessage() for example and you will know when it's finished.
>
>(Everyone, not just Nadya)
>
>I'm really just looking for the logic to determine when the message is done and before the next one starts. I know it is a simple logic problem of the getting the right thing in front of the right thing.
>
>I use this:
>
>
>m.MessageCount = m.MessageCount + 1
>
>
>In each CASE, so I think I might be able to hold a value in the MSH CASE and then if it is different than m.MessageCount after the CASE statement, that might help, but I can't quite get it to work.
Well, if you would be using a class, you would not be having a problem, since you can always examine a class property.
But anywway, once CASE is executed, the next CASE statement is not going to be evaluated and processed.
You may give us a bit more code to work with, because you're still talking riddles (for me, at least).
If it's not broken, fix it until it is.
My Blog