TIB_ColumnArray Object
Properties Methods

Unit
IB_Components

Declaration
TIB_ColumnArray = class(TIB_Column)

Description
Foundation upon which a custom class of array handling columns can be based.

This is designed to allow a way to derive fully functional components that will interact with the InterBase array column type.

I have provided a means to get and put the whole array or just a slice. It is possible to use variants or calls can be made to operate on your own memory declared to store the array. It is up to the developer to provide the buffer in which the data is read and written from when variants are not used. This is really an easy case as can be seen in this example where an array column declared to have bounds of 1 to 1024 of integer type:
procedure TForm1.btArrayClick(Sender: TObject);
var
  ii: word;
  ArrayValues: array [1..1024] of integer;
  ArraySize: ISC_LONG;
  tmpCol: TIB_ColumnArray;
begin
  if Sender = btWriteArray then begin
    for ii := 1 to 1024 do ArrayValues[ii] := ii;
  end else begin
    FillChar( ArrayValues, SizeOf( ArrayValues ), 0 );
  end;
  ArraySize := ISC_LONG( sizeof( ArrayValues ));
  tmpCol := QueryData.FieldByName( 'ARRAY_DATA' ) as TIB_ColumnArray;
  if Sender = btWriteArray then begin
    tmpCol.PutArray( @ArrayValues, @ArraySize );
    QueryData.Post;
  end else begin
    tmpCol.GetArray( @ArrayValues, @ArraySize );
  end;
  meArrayData.Lines.BeginUpdate;
  meArrayData.Lines.Clear;
  try
    for ii := 1 to 1024 do begin
      meArrayData.Lines.add( IntToStr( ArrayValues[ii] ));
    end;
  finally
    meArrayData.Lines.EndUpdate;
  end;
end;


Introduced Public Properties
ArrayDesc  This is the array description structure for the whole array.
ArrayID  This is the value that is needed in various API calls.

Introduced Public Methods
GetArray   This method reads the whole array into a buffer that you have declared directly via the API.
GetSlice   This method allows you to read the array or a slice of it into a buffer that you have declared directly via the API.
GetVarSlice   This method allows you to specify what dimensions of the array that you want placed into a variant array.
PutArray   This method writes the whole array from a buffer that you have declared directly via the API.
PutSlice   This method allows you to write the array or a slice of it from a buffer that you have declared directly via the API.
PutVarSlice   This method allows you to alter certain elements of the array by passing in a variant array holding what the new values should be.