trichview.support
List index out bounds |
Author |
Message |
Luis Diaz |
Posted: 02/17/2004 19:33:10 In the following code I obtain the message: List index out bounds(80) when the format of the 2º procedure is executed. Without the SetSelectionBounds, it works correctly. Why? {------------------------------------CargaSeccion--------------} procedure TEleMemList.CargaSeccion; var table: TRVTableItemInfo; i:integer; begin table := TRVTableItemInfo.CreateEx(1,3,rve.RVData); table.BorderWidth := 1; table.CellBorderWidth := 1; table.CellPadding := 5; for i:=0 to 2 do begin table.Cells[0,i].Clear; table.Cells[0,i].BestWidth:=100; table.Cells[0,i].BestHeight:=10; end; table.Cells[0,0].AddNL('Distrito Censal',1,0); table.Cells[0,0].AddNL(QueryMes.fieldbyName('ELEMES_DIST').AsString,2,1); table.Cells[0,1].AddNL('Sección',1,0); table.Cells[0,1].AddNL(QueryMes.fieldbyName('ELEMES_SECC').AsString+' '+ QueryMes.fieldbyName('ELEMES_SSEC').AsString,2,1); table.Cells[0,2].AddNL('Mesa',1,0); table.Cells[0,2].AddNL(QueryMes.fieldbyName('ELEMES_MESA').AsString,2,1); rve.AddItem('',table); rve.Format; rve.SetSelectionBounds(rve.ItemCount-1, 0,rve.ItemCount-1, 1); rve.ApplyParaStyle(2); 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; |
Powered by ABC Amber Outlook Express Converter