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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem using tell and seek

Status
Not open for further replies.

CJason

Programmer
Oct 13, 2004
223
US
I have the following code:

$floc = 74 - tell;
seek FILE, $floc, 1;

If I force $floc = -18, which is SHOULD be and it tells me that it is when I put a print $floc statement after the $floc assignment statement, everything is great. But, when I use the code above, it's not working properly?!?!?! Does tell put some sort of control characters in $floc??? Thanks for anyone's help!!!!!
 
it's not working properly?!?!?!
How do you know it's not working properly? What's it doing? (Or not doing?)

How are you opening the file?

Might help if we could see a bit more of the preceding code, say from the time you open the file. (Assuming it's not hundreds of lines or anything.)
 
Do you need to specify the file handle when you call tell()? It assumes the last file you read unless you say otherwise.

What value is tell() returning?

Mike

"Deliver me from the bane of civilised life; teddy bear envy."

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
tell is properly calculating "92", so the equation equates to "-18". However, if I put this calculated result into the seek command, it's almost like seek doesn't understand the "-18". But, when I replace $floc with the actual value "-18" (in the seek command), everything works fine?!?!?! Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top