FlexCel Studio for VCL/LCL
ContentsIndex
PreviousUpNext
TFlxMemTable.AddRecord Method

This method adds a new record to the table.

Pascal
procedure AddRecord(const aValues: Array of Variant);
C++
__fastcall AddRecord(const Array of Variant aValues);
Parameters 
Description 
const aValues: Array of Variant 
Array of values for the new record. Length(aValues) should be the same as the number of fields in the memory table. 

This method only has effect when you are in normal mode (that is, OnVirtualRecordCount is not set)

This example will create a normal FlxMemTable containing 2 columns and 5 records. Note that in normal mode, values will be kept into memory. If you don't want this, use virtual mode. 

 

Column 1 will be named "Number" and will have the values 0;1;2;3;4 

Column 2 will be named "Value" and will have the values 0;3;6;9;12 

 

We need to drop a TFlxMemTable on a form, double-click it, and define the columns "Number" and "Value" . 

Then drop a button, and define it's onclick event: 

 

procedure TForm1.Button1Click(Sender: TObject);
begin
  FlxMemTable1.AddRecord([0,0]);
  FlxMemTable1.AddRecord([1,3]);
  FlxMemTable1.AddRecord([2,6]);
  FlxMemTable1.AddRecord([3,9]);
  FlxMemTable1.AddRecord([4,12]);
end;
Copyright (c) 2002-2008 TMS Software. All rights reserved.
What do you think about this topic? Send feedback!