[futurebasic] Re: [FB] Re: how to avoid writing to the application's resource

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 2002 : Group Archive : Group : All Groups

From: Staz <staz@...>
Date: Wed, 08 May 2002 11:46:32 -0500
> 1) If I create a scrolling list in PG won't it put a STR# of a specific
> number in the application's resource. In this case wouldn't the one in an
> external preferences file have to have the same number to work with that
> scrolling list?Is there a way I can create a window with a scrolling list in
> PG that uses a STR# that is not in the application, but in an external file?
> 

pg requires a str# with a resource id to operate its lists. these would work
fine in x. that's not a problem. the problem is that the cdef is 68k based
and no 68k cdefs run in x. we hope to address this later. in the short term,
you might want to examine loadus 123 for an alternate method of displaying
lists.


> 2) Can the external file (preference file) be shared among multple users to
> access at the same time, and if not, can't I open and close the external
> preference file as I need it ?
> 

resource files cannot easily be shared. the resources are not written to the
disk until (a) memory is needed (b) the disk cache is flushed. you'll end up
with applications that trip over each other. if you have to share info, do
it in a data file opened with OPEN "N" and flush the disk cache after every
write

> Regarding the comments about deleting and replacing elements being a problem:
> I thought that was all cleared up since PG's STR#.INCL was changed to use
> pGchangedResource. Wasn't it?
> 

pg's routines are clean. i could explain the resource manager bug to you,
buy +my+ head would explode. the smart thing to do is just recreate the
string list each time.

h = fn newhandleclear(2) ' new list
for x = 1 to numberofitemstoadd
  def apndstr(a$(x),h)
next
fn pgreplaceres(h,_"STR#",_mystrlistid,"")


this always works mostly because there is only instance of dialog with the
resource manager and even he has a hard time screwing one little call. :)



-STAZ  ~)~