You are here: Symbol Reference > MtxVecDBTools Namespace > Classes > TVecColumn Class > public > TVecColumn.WriteDataset Method
MtxVec VCL
ContentsIndex
PreviousUpNext
TVecColumn.WriteDataset Method

Writes the contents of the Vector vector to dataset.

Pascal
procedure WriteDataset;

Writes the contents of the Vector vector to dataset. Depending on TMtxDataset.ReadWriteMode the following operation is performed: 

 

  • wmRecord => write all Vector properties to current record position. The underlying dataset field must be BLOB field, otherwise an exception is raised.
  • wmColumn => write Vector values to dataset. If Vector is complex then each complex value is saved as real + imaginary part on two consecutive places in dataset. Dataset must have at least Vector.Length (or Vector.Length *2 if Vector is complex) records, otherwise an exception is raised. The underlying dataset field must be numeric, otherwise an exception is raised.
procedure TForm1.FormCreate(Sender: TObject); begin MtxDataSet.Dataset := Table1; MtxDataSet.VecColumns.Clear; with MtxDataset.VecColumns.Add do begin FieldName := 'TimeAnalysis'; ReadWriteMode := wmRecord; end; // read only first field MtxDataset.VecColumns[0].ReadDataset; // do scale operation on VecColumns[0].Vector MtxDataset.VecColumns[0].Vector.Scale(2.5); // save changes back to dataset MtxDataset.VecColumns[0].WriteDataset; end;
void __fastcall TForm1::FormCreate(TObject *Sender) { MtxDataSet->Dataset = Table1; MtxDataSet->VecColumns->Clear(); TVecColumn *col; col = MtxDataSet->VecColumns->Add(); col->FieldName = "TimeAnalysis"; col->ReadWriteMode = wmRecord; // read only first field MtxDataset->VecColumns[0].ReadDataset; // do scale operation on VecColumns->Items[0]->Vector MtxDataset->VecColumns->Items[0]->Vector->Scale(2.5); // save changes back to dataset MtxDataset->VecColumns->Items[0]->WriteDataset(); }
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!