Subject | Re: [IBO] access to TIB_ColumnArray |
---|---|
Author | Geoff Worboys |
Post date | 2001-07-06T12:31:51Z |
> How do I access to elements of a TIB_ColumnArray,e.g.My question is always; Why would anyone want to use IBs array type?
> Integer[10,2]? I would like to multiply each column of a
> row for summarizing like a spreadsheet.
>
> Array sample of IBO does not help me really :(
Any column type without adequate support for manipulation on the
server should be avoided (IMHO). Blobs are bad enough, with arrays I
just pretend they dont exist.
Anyway, since I dont use them I can only give you the theory as I
understand it from the source...
Simplest interaction is achieved using variant arrays - this is what
IBOs interface has been designed to work with.
When you want to load array data into the field you create and fill a
variant array and give it to the PutVarSlice function. I think you
are supposed to be able to pass an array which is really just a subset
of values, and that should only change the corresponding values in the
IB array field.
When you want to get array data from the field you use the GetVarSlice
function to return a a variant (actually variant array) containing the
dimensions specified as the getvarslice parameters. You will need to
check that it has not returned variant Unassigned before trying to use
the returned variant array.
Once you have your variant array you can do whatever you want with it.
You may find it useful to look at the IB_ArrayGrid.pas unit for
examples of how this works in practice. There is also some
information available in the online help under TIB_ColumnArray.
Sorry I cant be of more help. Maybe someone with actual experience
can offer other examples to help you out.
Geoff Worboys
Telesis Computing