[futurebasic] Re: [FB] how many items can there be in a str# resource?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 2001 : Group Archive : Group : All Groups

From: Alain Pastor <apastor@...>
Date: Mon, 24 Sep 2001 20:15:28 +0200
Bowerbird@... wrote:
> 
> how many items can there be in a str# resource?
> 

Apparently, a difficult question to answer since nobody has come yet
with a reply.
OK, I'll bite. I've spent nearly two days counting all the items of
all the STR# resources of all the apps I have on my HD (989 files).
I used ResEdit and checked the results with Resorcerer afterward.
There is a tiny difference of 2 units, but I guess it's not
significant. So, as far as I can count, the answer is in between
three and fifty seven and a half. I suspect it vastly depends on a
few requirements and the speed of CPU on which the app will run, but
not on the free memory since you can store there only empty strings
that Jay might manage to pack into the four first bits of a byte (in
which case perhaps you could go up to 63 items). Notice that it
would be really convenient and you could dramatically increase the
performance of your apps doing so because you would have no need to
access the possible 63rd item, just getting the 1st one would to the
trick; this is merely due to the fact that an empty string always
equals another empty string even though it is uppercased.
Of course, an insane answer would be to say that as the first two
bytes of a STR# resource hold the string count, it should be
_maxInt, but I leave that to the gurus.
I did my homework as you can see, but actually I would like to know
the correct answer as well.
-- 

Cheers

Alain

-----------------------------------------------------
FB^3 in Europe:  http://euro.futurebasic.com/
FB II Pouch:     http://www.pixmix.com/FB/outils.html
-----------------------------------------------------