Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7037133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:30:27+00:00 2026-05-28T01:30:27+00:00

i posted a question on Fixing an error in a method declaration in a

  • 0

i posted a question on Fixing an error in a method declaration in a form in Delphi but after getting it fixed another error popped up upon compiling and its saying project project1.exe raised exception class EStringListError with message ‘list index out of bounds(0)’.when i press continue its not working but when i press break its flashing on the code neraz:=true;
this is my code below

Procedure Reload;
var
    i:integer;
begin
form1.ListBox1.Clear;
form1.ListBox2.Clear;
if neraz then
HD;
neraz:=true;//..................here
form1.Label3.Caption:='free: '+inttostr(vs*32)+' byte'+#10#13+'cluster size = 32 bytes';
  i:=TABLE[nk1].nach;
   KolP1:=0; KolP2:=0;
   while (FAT[i]<>1024)  do begin
      if TABLE[fat[i]].tip then begin
          form1.ListBox1.Items.Add('dir>'+TABLE[fat[i]].name);
          inc(kolP1);
      end
      else
          if TABLE[fat[i]].format='txt' then
                form1.ListBox1.Items.Add('f_text> '+TABLE[fat[i]].name+'.'+TABLE[fat[i]].format)
          else
                form1.ListBox1.Items.Add('f_bin> '+TABLE[fat[i]].name+'.'+TABLE[fat[i]].format);
      if (fat[i]<>0) then
      i:=fat[i];
   end;
   i:=TABLE[nk2].nach;
   while (FAT[i]<>1024)  do begin
      if TABLE[FAT[i]].tip then begin
          form1.ListBox2.Items.Add('dir>'+TABLE[fat[i]].name);
          inc(kolP2)
      end
      else
          if TABLE[fat[i]].format='txt' then
                form1.ListBox2.Items.Add('f_text> '+TABLE[fat[i]].name+'.'+TABLE[fat[i]].format)
          else
                form1.ListBox2.Items.Add('f_bin> '+TABLE[fat[i]].name+'.'+TABLE[fat[i]].format);
      if (fat[i]<>0) then
      i:=fat[i];
   end;
   vfail;
end;


procedure HD;
var
  i: integer;
begin
  for i := 0 to 49 do begin
    with form2.ListView1.Items[i] do begin
      SubItems[0] := TABLE[i].name;
      SubItems[1] := TABLE[i].format;
      if TABLE[i].tip then
        SubItems[2] := 'folder'
      else
        SubItems[2] := 'file';
      SubItems[3] := IntToStr(TABLE[i].nach);
      SubItems[4] := IntToStr(TABLE[i].razmer);
    end;
    form2.ListView2.Items[i].SubItems[0] := IntToStr(fat[i]);
  end;
end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:30:28+00:00Added an answer on May 28, 2026 at 1:30 am

    The exception class EStringListError raises the error List index out of bounds (0) when you try to access a member of a TStrings instance that is empty. The most likely candidate for that is the SubItems property of the list items.

    You would appear to have fallen into quite a common trap. Although you have created columns for the list view, you also need to fill out the SubItems list for each list item. A simple solution is to modify HD like this:

    with form2.ListView1.Items[i] do begin
      while SubItems.Count<5 do
        SubItems.Add('');
      SubItems[0] := ...
    

    Although it may in fact be better to add the sub-items at the same time that you create the list items. But I’m not showing code for that since you didn’t include the part of your program that populates the lists.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I posted a question re LDAP account management, but after exploring this, it's not
I posted another question earlier about getting the arguments from a context menu App.
I posted another question about the Roberts operator, but I decided to post a
I posted another question on a very similar topic, but turned out to be
Posted a question about an error I was getting the over day about Memory
I posted a question to the DBunit mailing list about an error I see
I posted a question before but I am yet limited to mix the code
I posted a question about this earlier, but I have more information now and
I have posted this question on The MapXtreme forum but since nobody ever answers
I'm sure this question HAS to have been asked, but after searching through the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.