Recent

Author Topic: [SOLVED] Summarizing the VirtualStringTree column  (Read 932 times)

Pe3s

  • Hero Member
  • *****
  • Posts: 633
[SOLVED] Summarizing the VirtualStringTree column
« on: July 12, 2022, 09:17:49 am »
Hello, I'm trying to write a column summation in VirtualStringTree. Can I ask more experienced colleagues for some hints?
Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button7Click(Sender: TObject);
  2. var
  3.   Data: PData;
  4.   Node: PVirtualNode;
  5.   SUM: Double = 0;
  6. begin
  7.   for Data in   do
  8.   SUM +=
  9.   Panel1.Text := FormatFloat('0.00', SUM);
  10. end;
  11.  
« Last Edit: July 13, 2022, 06:36:17 pm by Pe3s »

jamie

  • Hero Member
  • *****
  • Posts: 7492
Re: Summarizing the VirtualStringTree column
« Reply #1 on: July 13, 2022, 01:28:26 am »
Don't think you are going to get anywhere with that.

 There are 10 kinds of people out there, those that know binary and those that don't.
The only true wisdom is knowing you know nothing

paweld

  • Hero Member
  • *****
  • Posts: 1561
Re: Summarizing the VirtualStringTree column
« Reply #2 on: July 13, 2022, 06:43:59 am »
Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button7Click(Sender: TObject);
  2. var
  3.   Data: PData;
  4.   Node: PVirtualNode;
  5.   SUM: Double = 0;
  6. begin
  7.   Node := vst.GetFirst();
  8.   while Node <> nil do
  9.   begin
  10.     Data := vst.GetNodeData(Node);
  11.     SUM := SUM + Data^.ColumnToSum;
  12.     Node := vst.GetNext(Node);
  13.   end;
  14.   Panel1.Text := FormatFloat('0.00', SUM);
  15. end;
Best regards / Pozdrawiam
paweld

Pe3s

  • Hero Member
  • *****
  • Posts: 633
Re: Summarizing the VirtualStringTree column
« Reply #3 on: July 13, 2022, 06:35:55 pm »
@paweld Thank you very much

 

TinyPortal © 2005-2018