Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   nodos y la propiedad data en un Treeview (https://www.clubdelphi.com/foros/showthread.php?t=48346)

david_uh 22-09-2007 00:09:43

nodos y la propiedad data en un Treeview
 
he cargado datos de una tabla a un treeview y deseo almacenar info
relacionada a cada nodo, y he hecho esto:

Código Delphi [-]
 
type
  PData = ^TData;
  TData = record
  Id: Longint;
  Monto: Currency;
end;

 with ZData do
   begin
      First;
      while not(Eof) do
      begin
         New(inf);
         inf^.Id := FieldByName('id').AsInteger;
         inf^.Monto := FieldByName('monto').AsCurrency;
         Report.Items.AddChildObject( nodo,
            FieldByName('nombre').AsString+';'+
            FieldByName('monto').AsString, inf);
         Next;
         Dispose(inf); // he probado quitar esto pero igual
      end;
   end;
pero a toma el primer registro y la condicion de while not(Eof) do toma el valor de true
no se a que se debe pero;
estoy haciendo mal algo???

david_uh 22-09-2007 00:12:31

me olvidaba despues de defiir el tipo declaro estas variables

Código Delphi [-]
 
var
   child: TTreeNode;
   cond: String;
   inf: PData;


La franja horaria es GMT +2. Ahora son las 21:45:46.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi