Ignore:
Timestamp:
Jan 17, 2011, 6:55:36 AM (14 years ago)
Author:
george
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Generics/TemplateGenerics/Generic/GenericList.inc

    r114 r129  
    110110function TGList.Get(Index: TGListIndex): TGListItem;
    111111begin
     112  if (Index < 0) or (Index >= Count) then
     113    raise EListError.CreateFmt(SListIndexError, [Index]);
    112114  Result := FItems[Index];
    113115end;
     
    115117procedure TGList.Put(Index: TGListIndex; const AValue: TGListItem);
    116118begin
     119  if (Index < 0) or (Index >= Count) then
     120    raise EListError.CreateFmt(SListIndexError, [Index]);
    117121  FItems[Index] := AValue;
    118122end;
     
    175179  I := 0;
    176180  while I < Count do begin
    177     Items[I] := Source[I];
     181    FItems[I] := Source[I];
    178182    I := I + 1;
    179183  end;
     
    247251    raise EListError.CreateFmt(SListIndexError, [0])
    248252  else
    249     Result := Items[FCount - 1];
     253    Result := FItems[FCount - 1];
    250254end;
    251255
     
    255259    raise EListError.CreateFmt(SListIndexError, [0])
    256260  else
    257     Items[FCount - 1] := AValue;
     261    FItems[FCount - 1] := AValue;
    258262end;
    259263
     
    263267    raise EListError.CreateFmt(SListIndexError, [0])
    264268  else
    265     Result := Items[0];
     269    Result := FItems[0];
    266270end;
    267271
     
    271275    raise EListError.CreateFmt(SListIndexError, [0])
    272276  else
    273     Items[0] := AValue;
     277    FItems[0] := AValue;
    274278end;
    275279
     
    401405  I := 0;
    402406  while I < Count do begin
    403     Result := Result + Converter(Items[I]);
     407    Result := Result + Converter(FItems[I]);
    404408    if I < (Count - 1) then
    405409      Result := Result + Separator;
     
    469473  I := Start;
    470474  while I < Count do begin
    471     Items[I] := Value;
     475    FItems[I] := Value;
    472476    I := I + 1;
    473477  end;
Note: See TracChangeset for help on using the changeset viewer.