Android Question Value from Array repeats

Tim Chapman

Active Member
Licensed User
Longtime User
I am a new programmer and welcome advice regarding all aspects of this project. Anything you see in my code that can be improved, I would love to hear about.

I am using B4A 6.80 Beta #3.

Note that I chose listview intentionally because of saving resources compared to scrollview. I expect this code to grow and figured I would be conservative from the start. But I am finding that it is more difficult than Flexible Table or Scrollview.
Later, the spells list will have 9000 entries. So, I figured to just use listview from the start.

My project and all related files is attached as a zip file.
Some files must be put in the File.DirRootExternal folder on the device before running the code.

At line 170 I AddSingleLine to my listview. It works correctly getting the correct values from SkillList(i).Name.

If I comment out line 170 and do so in another identical loop at line 179, the last item repeats for all values of SkillList(i).Name.

Why can't use line 179 instead of 170 to do this?

To see the result, click the Skills tab.

Thanks again for assistance.

Tim
 

Attachments

  • files.zip
    6.2 KB · Views: 228
Last edited:

Tim Chapman

Active Member
Licensed User
Longtime User
Solved. This is an issue of passing variables by reference or by value. I moved the Dim Skill As SkillDetail statement to inside the loop that assigns values to SkillList(). My brother was of great assistance to me on this.
 
Upvote 0
Top