Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Conditional logic problem
Message
From
09/08/2007 11:05:04
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
08/08/2007 12:27:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01246593
Message ID:
01247017
Views:
34
Yes, that was the solution. I'm not sure if that's what you meant in your code, but I understood it from what you wrote below. Thanks!

>The problem as I understood it is..........
>
>When you come to an MSH record it means that you have finished processing the previous set of records and want to send a completion message. However, since the first record in the file is an MSH record you need some logic to preclude sending the message for that one record.
>
>What I tried to indicate was something on the order of
>
>1. Before processing any records set a flag that says you are on first message
>
>2. When you hit a beginning of message indicator (MSH record), check the flag. If it is true you are processing the first message and don't want to send the completion message. But you do want to reset the first_message_flag. If the first_message_flag is false it means you have completed the previous message and can send your completion message.
>
>3. Continue to process the record exactly as you did before.
>
>4. When you have finished processing all messages in the file, send a completion message for the final one.
>
>If your processing is not as I understood it (or there are more complexities), then I guess this won't work very well.
>
>.....Rich
>
>>>
>>>llFirstRecord = .T.
>>>FOR EACH lineofText IN oText
>>>  DO CASE
>>>     CASE LEFT(lineofText,3) = "MSH" AND llFirstRecord
>>>        llFirstRecord = .F.
>>>     CASE LEFT(lineofText,3) = "MSH"
>>>        SendCompletionMessage
>>>     OTHERWISE
>>>        && Do Nothing - must be EVN, etc. record
>>>  ENDCASE
>>>
>>>  DO CASE
>>>    CASE "MSH"
>>>    CASE "EVN"
>>>    CASE "ETC"
>>>  ENDCASE
>>>ENDFOR
>>>SendCompletionMessage  && For Last set of records
Previous
Reply
Map
View

Click here to load this message in the networking platform