trichview.com

trichview.support




Re: List index out bounds


Return to index


Author

Message

LDiaz

Posted: 02/19/2004 10:56:52


The procedures are executed in this order:

{----------------------CargaCabecera-------------}

procedure TEleMemList.CargaCabecera;

var Stream: TFileStream;

begin

  if fileExists(ExtractFilePath(ParamStr(0))+'Textos\EleMemListCab.rvf')

then

    begin

      Stream := TFileStream.Create(

                ExtractFilePath(ParamStr(0))+'textos\EleMemListCab.rvf',fmOpenRead);

      try

        rve.InsertRVFFromStream(Stream,rve.ItemCount);

      finally

        rve.Format;

        Stream.Free;

      end;

    end

  else

    Showmessage('No existe '+ExtractFilePath(ParamStr(0))+'textos\EleMemListCab.rvf');

end;

{----------------------------CargaTitulos--------------}

procedure TEleMemList.CargaTitulos;

var table: TRVTableItemInfo;

    i:integer;

begin

  table := TRVTableItemInfo.CreateEx(1,6,rve.RVData);

  table.BorderWidth := 1;

  table.CellBorderWidth := 1;

  table.CellPadding := 5;

  for i:=0 to 5 do

    begin

      table.Cells[0,i].Clear;

    end;

  table.Cells[0,0].BestHeight:=14;

  table.Cells[0,0].BestWidth:=150;

  table.Cells[0,0].AddNL('1� APELLIDO',0,1);

  table.Cells[0,1].BestWidth:=150;

  table.Cells[0,1].AddNL('2� APELLIDO',0,1);

  table.Cells[0,2].BestWidth:=150;

  table.Cells[0,2].AddNL('NOMBRE',0,1);

  table.Cells[0,3].BestWidth:=80;

  table.Cells[0,3].AddNL('DNI',0,1);

  table.Cells[0,4].BestWidth:=250;

  table.Cells[0,4].AddNL('DIRECCI�N',0,1);

  table.Cells[0,5].BestWidth:=150;

  table.Cells[0,5].AddNL('CARGO EN LA MESA',0,1);

  rve.AddItem('',table);

  rve.Format;

//  rve.SetSelectionBounds(rve.ItemCount-1, 0,rve.ItemCount-1, 1);

//  rve.ApplyParaStyle(1);

end;

{-------------------------------CargaMembros--------------}

procedure TEleMemList.CargaMembros;

var table: TRVTableItemInfo;

    lin:Integer;

    i:integer;

    Cargo:String;

    Part:String;

begin

  table := TRVTableItemInfo.CreateEx(9,6,rve.RVData);

  table.BorderWidth := 1;

  table.CellBorderWidth := 1;

  table.CellPadding := 5;

  for lin:=0 to 8 do

  begin

    case lin of

      0: begin Part:='P1'; Cargo:='PRESIDENTE/A'; end;

      1: begin Part:='1V1'; Cargo:='1� VOCAL'; end;

      2: begin Part:='2V1'; Cargo:='2� VOCAL'; end;

      3: begin Part:='P2'; Cargo:='PRESIDENTE/A - 1� Suplente'; end;

      4: begin Part:='P3'; Cargo:='PRESIDENTE/A - 2� Suplente'; end;

      5: begin Part:='1V2'; Cargo:='1� VOCAL - 1� Suplente'; end;

      6: begin Part:='1V3'; Cargo:='1� VOCAL - 2� Suplente'; end;

      7: begin Part:='2V2'; Cargo:='2� VOCAL - 1� Suplente'; end;

      8: begin Part:='2V3'; Cargo:='2� VOCAL - 2� Suplente'; end;

    end;

    for i:=0 to 5 do

      begin

        table.Cells[lin,i].Clear;

      end;

    table.Cells[0,0].BestHeight:=14;

    table.Cells[lin,0].BestWidth:=150;

    table.Cells[lin,0].AddNL(QueryMes.fieldbyName('ELEMES_'+Part+'_APE1').AsString,0,0);

    table.Cells[lin,1].BestWidth:=150;

    table.Cells[lin,1].AddNL(QueryMes.fieldbyName('ELEMES_'+Part+'_APE2').AsString,0,0);

    table.Cells[lin,2].BestWidth:=150;

    table.Cells[lin,2].AddNL(QueryMes.fieldbyName('ELEMES_'+Part+'_NOME').AsString,0,0);

    table.Cells[lin,3].BestWidth:=80;

    table.Cells[lin,3].AddNL(QueryMes.fieldbyName('ELEMES_'+Part+'_DNI').AsString,0,1);

    table.Cells[lin,4].BestWidth:=250;

    table.Cells[lin,4].AddNL(QueryMes.fieldbyName('ELEMES_'+Part+'_ENDE1').AsString,1,0);

    table.Cells[lin,4].AddNL(QueryMes.fieldbyName('ELEMES_'+Part+'_ENDE2').AsString,1,0);

    table.Cells[lin,5].BestWidth:=150;

    table.Cells[lin,5].AddNL(Cargo,0,0);

  end;

  rve.AddItem('',table);

  rve.Format;

  rve.SetSelectionBounds(rve.ItemCount-1, 0,rve.ItemCount-1, 1);

  rve.ApplyParaStyle(1);

end;

{---------------------------CargaPie------------------}

procedure TEleMemList.CargaPie;

var Stream: TFileStream;

begin

  if fileExists(ExtractFilePath(ParamStr(0))+'Textos\EleMemListPie.rvf')

then

    begin

      Stream := TFileStream.Create(

                ExtractFilePath(ParamStr(0))+'textos\EleMemListPie.rvf',fmOpenRead);

      try

        rve.InsertRVFFromStream(Stream,rve.ItemCount);

      finally

        rve.Format;

        Stream.Free;

      end;

    end

  else

    Showmessage('No existe '+ExtractFilePath(ParamStr(0))+'textos\EleMemListPie.rvf');

end;


The program worked well, but I inserted an image at the end of the text "

CargaPie " and then  give that error. The text was Edit with RvActions.





Powered by ABC Amber Outlook Express Converter