How to create an array of ListView

xray12frank

Member
Licensed User
Longtime User
Hello to all..I need help.
I'm just writing a programm which calculates the winning table in a lotto-system and I have to calculate and showing a two dimensional sheet. I prefer the ListView, but there is only one dimension. So how can I create a tab with a1,1..a1,8 and a11,1..a8,a11 as a table of ListView ( 2 dimensioned array)??
Thanks a lot for helping me Hope I c.u

@ Klaus..I used the search option very hard!!
 

klaus

Expert
Licensed User
Longtime User
Sorry, but I don't understand what exaxtly you want to do.
This is clear to me a1,1..a1,8
But this is not clear a11,1..a8,a11 shouldn't it be a11,1 .. a11,8 ?
If you have a two dimensional array you would have something like a(row, col).
Be aware that in B4A indexes begin with 0 and not with 1.

Why do you want to use ListViews and how do you imagine them ?
Do you want one ListView for each column ?
You should have a look at Erel's Table class or CustomListView class which are much more suitable for what I suppose you want to do.

Best regards.
 
Last edited:
Upvote 0

xray12frank

Member
Licensed User
Longtime User
Hello Klaus,
First I Thank you for prompting my post..
I remember you also write answers in German..
So my question again:

Lieber Klaus, ich möchte eine zwei-dimensionale Tabelle auf den Screen bringen. Zunächst habe ich es mit Labels probiert und jede Zelle in einer 9*11 Matrix über SUBS mit Werten gefüllt.
Das ist zugegebener massen bescheiden.. Dann habe ich ListView entdeckt. Sodann habe ich alle 9 Spalten mit ListView1(ITEM1..11)..ListView9(ITEM1..!) im Designer eingerichtet. Meine Frage war nur.. kann man ein Array mit ListView(zeile,spalte) oder auch anders herum indiziert erzeugen und wie werden die berechneten Werte zugewiesen.
LG aus Heinsberg..and that to all
 
Upvote 0

xray12frank

Member
Licensed User
Longtime User
Sorry, but I don't understand what exaxtly you want to do.
This is clear to me a1,1..a1,8
But this is not clear a11,1..a8,a11 shouldn't it be a11,1 .. a11,8 ?
If you have a two dimensional array you would have something like a(row, col).
Be aware that in B4A indexes begin with 0 and not with 1.

Why do you want to use ListViews and how do you imagine them ?
Do you want one ListView for each column ?
You should have a look at Erel's Table class or CustomListView class which are much more suitable for what I suppose you want to do.

Best regards.

Hello Klaus, you wrote a(row,col).. I did it so:
a(1,1)..a(1,8)
a(2,1)..a(2,8)
:
:
a(11,1) .. a(11,8)
and all col (1..8) should be ListViews
or even ARRAYS OF LISTVIEW 111

So my intention is to create a two-dimensinal arrays and to fill it by yousing a sub for calculating and writing the esults in the sheet!
c.u.
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
Still the same question, why using ListViews ?
ListViews are intendet to display long lists with scrolling.
You can do it with Labels:
- either with a two dimension Label array.
- or just with Labels.

Attached two examples.

Best regards.

Immer noch die gleiche Frage, warum ListViews ?
ListViews sind zum Anzeigen von langen Listen mit scrolling gedacht.
Du kannst es einfach mit Labels machen:
- entweder mit einem zweidimensionalen Labelarray
- oder einfach mit Labels.

Beiliegend zwei Beispielprogramme.

Beste Grüsse.
 

Attachments

  • Tabelle.zip
    6.1 KB · Views: 238
  • Tabelle1.zip
    6.2 KB · Views: 215
Upvote 0

xray12frank

Member
Licensed User
Longtime User
Arrays Of List

Wow Klaus..
thank you for that genuin code.. It seem's to working fine. But I thought it would be easier to create an array of ListViews cause the rows are "nearly" signed out and I only have to create more colums.. Ups today my english is rather bad..

Hallo Klaus, dachte so.. wenn ich schon eine Listview mit x1..xn Zeilen habe brauche ich nur noch die entsprechenden Spalten der ListView mit x1..xn Zeilen und fertig. Aber was du gepostet hast ist super!! DANKE dafür..
Aber dennoch, gibt es eigentlich eine Möglichkeit ein ListView - Array zu erstellen?? LG Frank
 
Upvote 0
Top