>Jay, Robert and Robin > >Thanks for the explanation guys - sorry I missed the bit in the reference >manual. i rely too much on the examples some times. > >What this means of course is that an XREF array is ony really "dynamic" in >one dimension, the other dimension is fixed at least as far as memory >usage goes. > >I've been trying to work up a decent spreadsheet module that gives a full >range of functionality (multiple sheets, resizable cells, formating etc.) >and the 2D array was the easiest way to store the data. > >If I want this thing to be truely dynamic, with the size of the sheet set >only by available memory then I will need to use a more complicated system >for data storage. > >I can see a few ways to do this, but if anyone has any ideas I'd love to >hear them. > > >Thanks again > >David > >PS - Not really a beta issue, hence perhaps a private reply if you have >any good ideas. > David, I've taken the liberty of moving this to the FB list and changing the title. I think I would approach this as a dynamic array of dynamic arrays. Each array would be single-dimensional, allowing complete flexibility. xref@ columnHndls(1) as handle xref@ cells(1) as cellRecord columnHndls = fn newhandle(currNnumberOfCols*sizeof(handle)) for r = 0 to numberOfCols columnHndls(r) = fn newhandle(currNumberOfRows*sizeof(cellRecord)) next to access the row-5 cell in column 12: cells = columnHndls(12)'Set array to column 12 myCellRec = cells(5)'Extract cell 5 Looks pretty easy to me. Of course you will have to determine what goes into each cellRecord. When you change the size of the sheet, you just change the size of the columnHndls handle to the appropriate number of columns, then change the size of each cells handle to the new number of rows. You can reference another sheet just by slipping a handle to a different list of column handles into columnHndls! Slick. Let us know where you come out. 0"0 =J= a y "