Newsgroups: comp.sys.mac.programmer
Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!sharkey!sbcs!usenet
From: rmiller@sbcs.sunysb.edu (Robert Miller)
Subject: Trouble with the File Manager
Message-ID: <1990Aug25.215934.17867@sbcs.sunysb.edu>
Sender: usenet@sbcs.sunysb.edu (Usenet poster)
Organization: State University of New York at Stony Brook
Date: Sat, 25 Aug 90 21:59:34 GMT

I've recently written a routine which is supposed to write data
from one of my global data structures to a file.  The problem is,
it is not writing the data.  It *is* writing some of the string 
literals I have defined in another part of my program.  

The code in question looks like this:

count=1;
...
for (i=0....i++)
result = FSWrite(file, &count, &theClause[i]);
...

I looked at this code with the debugger, and at the time of execution
of the FSWrite, count was still equal to 1, and theClause[i] was still
the value I expected, but a different value was written to the file.

I'm using Think C 4.0.

And yes, I know there are better ways to write a data structure to a
file than one byte at a time.  I tried them first, and I got the same
result.

Any ideas?

Robert
rmiller@sbcs.sunysb.edu
