----------컴파일후 버튼1을 클릭했을경우 나오는 메세지(델파이4에서)---
Project ProJect1.exe raised exception class EStringlistError With
Message 'list index out of bounds (13)'.Process stopped. Use Step
or Run to continue.
---------------------------------------------------------------------
소스
---------------------------------------------------------------------
procedure TForm1.Button1Click(Sender: TObject);
var
Han:TStringList;
i:Integer;
begin
han := Tstringlist.Create ;
han.LoadFromFile('c:han.dat');
for i:=0 to Han.Count do
listbox1.Items.Add(Han.Strings[i]);
end;
---------------------------------------------------------------------
=> for i:=0 to Han.Count - 1 do
로 바꾸면 될듯한데요...
[델파이] wrote:
> ----------컴파일후 버튼1을 클릭했을경우 나오는 메세지(델파이4에서)---
> Project ProJect1.exe raised exception class EStringlistError With
> Message 'list index out of bounds (13)'.Process stopped. Use Step
> or Run to continue.
> ---------------------------------------------------------------------
> 소스
> ---------------------------------------------------------------------
> procedure TForm1.Button1Click(Sender: TObject);
> var
> Han:TStringList;
> i:Integer;
> begin
> han := Tstringlist.Create ;
> han.LoadFromFile('c:han.dat');
> for i:=0 to Han.Count do
> listbox1.Items.Add(Han.Strings[i]);
> end;
> ---------------------------------------------------------------------