>>>I want to extract the string between the asterisks, or between an asterisk and the tilde if it's the last occurrence. If I use StrExtract() with occurrences from 1 to 4, I get "4" "3" "23" and "0" as results in the example below.
>>>
>>>
>>>m.test = "HL*4*3*23*0~"
>>>
>>>
>>>This evaluates to "" because there is no second asterisk for the fourth occurrence:
>>>
>>>m.String = STREXTRACT(m.test, "*", "*", 4)
>>>
>>
>>Edward has the right answer.
>>
>>Isn't EDI fun?
>
>No. I hate it. I thought HL7 was tough - and it was - but the loops in EDI suck.
>
>Have you ever used anything that could reliably parse messages that was compatible with Foxpro?
I agree.
I've never had to luckily. I've only written apps that create EDI documents, not read them. I've done them in FPD2.5 and in VFP.
____________________________________
Don't Tread on Me
Overthrow the federal government NOW!
____________________________________