Q&A

  • [긴급] List index out of bounds(7)뭐예요
쿼리를 해서 텍스트 파일을 생성하던 중에 List index out of bounds(7)에러가 나요

전에 잘 되던 것인데요

뭘 만졌는지... 이상해요

뭐때문에 나는 에러인가요...

도와주세요...

1  COMMENTS
  • Profile
    안치봉 1999.06.26 22:42
    초보 께서 말씀하시기를...

    > 쿼리를 해서 텍스트 파일을 생성하던 중에 List index out of bounds(7)에러가 나요

    > 전에 잘 되던 것인데요

    > 뭘 만졌는지... 이상해요

    > 뭐때문에 나는 에러인가요...

    > 도와주세요...



    잘은 모르겠습니다만...



    예를 들어 아이템의 갯수가 10개인데 11번째의 아이템을 액세스할려고



    하면 List index out of bounds(11) 이 발생합니다.



    가령...



    funtion TMyTest.GetItem(Index: integer): integer;

    begin

    if Index < 0 then

    raise Exception.Create('List index out of bounds(' + IntToStr(Index) + ')');



    if Index > 최대아이템의수 then

    raise Exception.Create('List index out of bounds(' + IntToStr(Index) + ')');



    Result := 아이템[Index];

    end;