Ver Mensaje Individual
  #22  
Antiguo 21-11-2022
Avatar de Angel.Matilla
Angel.Matilla Angel.Matilla is offline
Miembro
 
Registrado: ene 2007
Ubicación: Toledo - España
Posts: 1.418
Reputación: 21
Angel.Matilla Va por buen camino
Después de darle muchas vueltas y hacer un montón de pruebas, esta mañana me ha venido una idea a la cabeza: dado que el VST tiene activadas las casillas de selección, daba la impresión que al empezar a recorrer el árbol se inicializan los nodos. He hecho varias pruebas con el código así:
Código:
Lista->OnInitNode = NULL;     // Añadida para que no inicialice los nodos
Nodo = Lista->GetFirst();
while (Nodo != NULL)
{
     if (!Lista->HasChildren[Nodo] && Lista->CheckState[Nodo] > csUncheckedPressed)
     {
          try
          {
               fMenu->Query->Close();
               fMenu->Query->ParamByName("PrvIns")->AsString = PrvIns;
               fMenu->Query->ParamByName("RefInt")->AsString = ((PTreeSelRec)Lista->GetNodeData(Nodo))->RefInt;
               fMenu->Query->ParamByName("Forma")->AsInteger = ((PTreeSelRec)Lista->GetNodeData(Nodo))->ForPago;
               fMenu->Query->ParamByName("Junta")->AsInteger = StrToInt(((PTreeSelRec)Lista->GetNodeData(Nodo))->Concepto);
               fMenu->Query->ExecSQL();
               nRecibos += fMenu->Query->RowsAffected;
               fMenu->Query->Transaction->Commit();
          }
          catch(...)
          {
               Screen->Cursor = crArrow;
               fMenu->Query->Transaction->Rollback();
               Application->ProcessMessages();
               return;
          }
     }
     Nodo = Lista->GetNext(Nodo);
}
Lista->OnInitNode = ListaInitNode;     // Añadida para restaurar la acción al volver a cargar
y parece que va bien.
Responder Con Cita