Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fgets
Message
 
À
01/08/2001 15:56:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Re: Fgets
Divers
Thread ID:
00538523
Message ID:
00538528
Vues:
10
>Has anyone had a problem with fgets(). We have a program that goes through a text file and sets the length of the string to 500.
>
>The problem is the function FGETS() function is only pulling 238 characters, but when you use the LEN() function in FOX it says the length is 500. The characters after 238 are geting truncated.
>
>Does fgets have a bug!!!

Direct from the Hackers guide about Fgets, thought it may help.

***

FGETS() reads data from a low-level file. FGETS reads characters until it reaches the first of these three limits: the number of characters specified in the second parameter, the first (next) occurrence of a carriage return, or the end of the file.

Usage cString = FGETS( nFileHandle [, nBytes ] )


Parameter
Value
Meaning

nFileHandle
Integer
The file handle created with FOPEN() or FCREATE().

nBytes
Numeric
Maximum number of bytes to read; defaults to 254 if not specified.

cString
Character string
Characters read.


Example lcRetVal = FGETS(8,400)


The above example reads characters from file handle 8, starting at the current file position, and ending at the first occurrence of a carriage return, the specified number of bytes, or the end-of-file (hint: test FEOF()).


****

Could you be hitting the Carriage return in your Fgets, thus stopping anymore from being read?
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform