[futurebasic] Re: [FB] Re: XREF Me

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

From: Robin <robinc@...>
Date: Mon, 05 Feb 2001 09:42:30 +1000
> I cant see how this would work - at some point you need to calculate the size
> of the memory block - XREF takes care ofthe offsets for each element in the
> array. I'm not sure that the offsets can be calculated dynamically, and
> keeping track of the memory blocks size could also be fun.
> 
> What do the experts think?

I always do the XREF@ to the maximum dim possible:

_maxDim = _maxlong-1'needed to avoid problems with bounds checking

XREF@ array(_maxDim) as recordtype

so it works no matter how much memory I actually use. For making sure I
don't overfill my handle, I either know in advance how big it is, or fill it
using a function which makes sure there's enough room and expands the handle
if required (e.g. by storing how many elements I've used in the first
element).

-- 
Robin
====================================================
Genesearch Pty Ltd
E-mail: robinc@...
WWW:    http://www.genesearch.com.au
====================================================