Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine if fgets ends with CR or length of 8192
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01529844
Message ID:
01529850
Vues:
45
>>>I am parsing Medical HL7 format records. I'm using fgets() to read them as a flat file. Some of the record formats have interpretations of the data that exceeds the 8192 maximum length of the fgets. When I get the data if the length is less than 8192 then it is obvious the length is what it is. If the length of the data is 8192 how can I tell if the fgets completed because of a CR or there is more data for that record?
>>
>>
>>lcString = FGETS(lnHandle, 8192)
>>IF RIGHT(lcString, 1) == CHR(13)
>>   *** Ends with CR
>>ENDIF
>>
>>
>>BTW why not use FILETOSTR() and then ALINES()?
>>Of course if the file is relatively small.
>
>Not gonna work. FGETS() does not return EOL characters

Didn't know this.
Thnaks
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform