[futurebasic] Re: [FB] Dynamic record array size

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

From: Bernie Wylde <bernie.w@...>
Date: Thu, 26 Sep 2002 06:51:33 +0100
Jay,
I understand about elem 0. I meant to say "highest element number" but
thanks for pointing it out.

It was the mention of auto-compression in the manual that gave me visions of
irregular sized and/or omitted (unused) elements. I've since checked out
COMPRESS DYNAMIC.

Cheers
Bernie

BTW, thanks for "Jay's Arrays" on the new CD.



Jay wrote:

> Bernie Wylde wrote:
>> To determine the number of elements in a previously saved dynamic record
>> array, would one use:
>> 
>> elems = LOF(1,1)\\SIZEOF(listRec)-1     '(where listRec is the record type)
>> 
>> or could this be inaccurate?
>> 
> Bernie,
> 
> Providing you have used WRITE DYNAMIC to save the array, this should be
> accurate. Be sure you understand the difference between the element
> count (includes elem 0) and the number of the top element (1 less). Your
> code looks as though you do.
> 
> e-e
> =J= a  y
> "
> 
> PS. You might be interested to know that when you call READ DYNAMIC, the
> code the runtime uses to set the number of elements is this:
> 
> address&.AutoXREFCurr& = TotalBytes& \\ bytes&
> 
> where bytes& is the record size and TotalBytes& is the size of the
> handle. In other words, it's essentially the same thing you did.
>