Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fputs() and control characters

Status
Not open for further replies.

chandler

MIS
Dec 10, 2000
66
0
0
US
I'm using the fputs() function to send text to a text file, but the beginning of each line in the text file is showing 2 squares for some control characters. Am I missing a parameter?

FSEEK(_splits,2,2)
fputs(_splits,ALLTRIM(pname))

Chandler
I ran over my dogma with karma!
 
Why not check STRTOFILE() in Help?
Much easier to use :)
I suppose these two char are CR LF (but not sure).

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
 
You're not missing a parameter, just coding your FSEEK wrong...

try
Code:
FSEEK( _splits, [b]0[/b], 2)

The way you have it is that you're moving you're file pointer to 2 bytes BEYOND the end of the file.

If you were trying to backtrack 2 characters, try
Code:
FSEEK( _splits, [b]-2[/b], 2)
 
FSEEK( _splits, 0, 2)

That's it. Thanks.

Chandler
I ran over my dogma with karma!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top