Ver Mensaje Individual
  #11  
Antiguo 13-11-2014
Avatar de danielmj
danielmj danielmj is offline
Miembro
 
Registrado: jun 2011
Posts: 383
Reputación: 13
danielmj Va por buen camino
Hola de nuevo,

he cambiado el codigo a esto:
Código Delphi [-]
procedure TrForm.FormActivate(Sender: TObject);
var
  i: integer;
  total: extended;
  total2: TStringList; //variable de pruebas

begin
  total2.Create;
  for i:= 0 to lista.Items.Count -1 do
    begin
      total2.Add(lista.Items[i].SubItems[9]); //Esta linea da error "access violation"
      total:= total + strToFloat(total2.Text) ; //(StrToFloat(lista.Items.Item[i].SubItems[11]));
      Label35.Caption:= FloatToStr(total);
      label36.Caption:= total2.Text;
    end;
end;

He intentado basarme en este código:
Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var
   i : Integer;
   StrList : TStringList;
begin
   StrList := TStringList.Create;
   StrList.Duplicates := dupIgnore;
   StrList.Sorted := True;
   for i := ListView1.Items.Count-1 downto 0 do
   begin
      if LowerCase(ListView1.Items[i].SubItems[0]) = LowerCase(Edit1.Text) then
         StrList.Add(ListView1.Items[i].SubItems[0])
      else
         ListView1.Items.Delete(i);
   end;
   ShowMessage(StrList.Text);
   StrList.Free;
end;

Que peternece a este post http://www.clubdelphi.com/foros/showthread.php?t=82673, ahí se usa un messagebox para mostrar el valor y yo uso una etiqueta, creo que es la unica diferencia, aun asi, no me funciona. Ni puedosumar los valores de una columna ni me muestra en el label el contenido de una celda de la lista.
Ya estoy desesperao, incluso he cerrado delphi varias veces cabreao y al rato vuelvo a insistir en vano.

En fin, saludos.
__________________
La juventud pasa, la inmadurez se supera, la ignorancia se cura con la educación, y la embriaguez con la sobriedad, pero la estupidez dura para siempre. Aristofanes.

Última edición por danielmj fecha: 13-11-2014 a las 12:51:20.
Responder Con Cita