Ok, we need to talk. I'm having a heck-of-a-time reading this HL7 stuff. What are you doing with this once you have a line as a record in the cursor? You still have to parse out all the stuff in the Memo field. And I can't wait to get to the mapping part where I put the stuff into our tables...
>Jay
>
>Don't know if this help you at all, but I create a temporary cursor, and then use FGETS to read the file. It breaks on a carriage return so I get each segment of the message into a separate row in the cursor.
>
>
>CREATE CURSOR cursor1 (resultrow M)
>
>****************************************************************************
>* Open HL7 Message (File) and do low level reads for each line of data
>* insert each row into a new row in the temp database
>****************************************************************************
>lnHan=FOPEN(lcFile,0)
>DO WHILE !FEOF(lnHan)
> lcString=FGETS(lnHan,2000)
> APPEND BLANK
> replace resultrow WITH lcString
>ENDDO
>FCLOSE(lnHan)
>
>
>
>Kirk