error seeking in file
Mike Bonner
bonnmike at gmail.com
Mon Nov 22 21:46:55 EST 2010
Noticed that you were using filename as your variable name, but it is a
reserved word, you should probably change it to tFilename or whatever
alternative name you wish.
In addition, I think you will probably want to open the file in update mode,
or for write, depending on what you wish to accomplish. Update or append can
leave parts of the file unchanged, but the way I read your description, it
sounds like you will want a complete overwrite, in which case opening for
write makes it easy.
On Mon, Nov 22, 2010 at 7:30 PM, Mike Kerner <MikeKerner at roadrunner.com>wrote:
> UGH - never mind - in the dox I took "start" literally, when I should have
> specified a position, e.g. 0
>
> On Mon, Nov 22, 2010 at 21:11, Mike Kerner <MikeKerner at roadrunner.com
> >wrote:
>
> > I'm on a mac using 4.5.1, trying to mess around with something that I'd
> > like to put on my ipod eventually. So I'm trying to open an external
> file
> > to hold preferences.
> >
> > code reads:
> > put "test" into filename
> > open file filename
> > read from file filename until eof
> > put it into contents
> > ask "new contents" with contents
> > put it into contents
> > write contents to file filename at start
> >
> > put the result into theresult -- DEBUG
> > answer "the result is"&& theResult -- DEBUG
> >
> > close file filename
> >
> >
> > Since i was not able to update the contents of the file I added the DEBUG
> > statements in.
> >
> > When attempting to update filename, the message I am getting in theResult
> > is "error seeking in file". What does that mean? How do I fix it?
> >
>
>
>
> --
> On the first day, God created the heavens and the Earth
> On the second day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
> and did a little diving.
> And God said, "This is good."
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list