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

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

From: Jay <jktr@...>
Date: Wed, 25 Sep 2002 22:22:45 -0500
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.