Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conditional logic problem
Message
De
07/08/2007 19:39:34
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
07/08/2007 17:09:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01246593
Message ID:
01246665
Vues:
26
>>>>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.
>>>
>Does something like this work for you??????????

No, there could be different ones other than EVN. I knew I should have put all the case statement in, but I thought just showing the two would be good enough.

>
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform