[futurebasic] Re: STR# and Mod question

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1997 : Group Archive : Group : All Groups

From: Rick Brown <rbrown@...>
Date: Thu, 04 Dec 1997 21:00:24 -0600
Terrald J. Smith, M.D. wrote:
> > > 1)  I am using the STR# resource and PG with the STR.INCL.  I am trying
> > > to import strings with a length of 118 from a text file.  It does great
> > > and fast up to record number 529.  Then I get an Error message.
> > >
> > > Error #: -39
> > > CHANGERESOURCE failed.
> > > The modified resource coudnot be
> > > marked as changed.

Hans replied:
> > Try to CALL UPDATERESFILE(gResRef) frequently when you import larger
> > strings.
> > Your problem is you have to litle memory left on your harddisk.

Terrald replied:
> Sorry....don't think this is an optional problem as far as the memory
> goes......I have a 6G hard disk.  Also, Staz notes in his documentation of PG
> (I think) not to do CALL UPDATERESFILE(gResRef).

Terrald, I think Hans may yet be on to something.  Here's a quote from
Inside Mac:

"When called, ChangedResource reserves disk space for the changed
resource. The procedure reserves space every time you call it, but the
resource is not actually written until you call WriteResource or
UpdateResFile. Thus, if you call ChangedResource several times before
the resource is actually written, the procedure reserves much more space
than is needed. If the resource is large, you may unexpectedly run out
of disk space. When the resource is actually written, the file’s
end-of-file (EOF) is set correctly, and the next call to ChangedResource
will work as expected.
If your application frequently changes the contents of resources
(especially large resources), you should call WriteResource or
UpdateResFile immediately after calling ChangedResource."

- Rick