[Gambas-user] array of object is SO needed
roberto
roberto.premoli at tiscali.it
Tue Mar 31 12:16:18 CEST 2020
hi.
i am doing a "sudoku" game.
i have a matrix of 81 labels, from "label1" to "label81" as containers
of the numbers (to show them to user)
i have matrix to container of number (to "elaborate" them).
To fill the textlabels i have to do
if matrix[1] <> 0 then label1.text=matrix[1]
if matrix[2] <> 0 then label2.text=matrix[2]
...
if matrix[81] <> 0 then label81.text=matrix[81]
also to clean or assign different background color, i have to write 81
times the same command on different labels.
it will be HUGE better to have array of objects to allow some the follow:
for n = 1 to 81
if matrix[n] <> 0 then label[n].text = matrix[n]
next
At my eyes, absence of object arrays is the worsest weakness of gambas.
PS: in past i did bigger programs with hundreds of labels and all of
them must be worked one by one, it was a mess (doing cut and past and
renumbering, it is so common to do a mistake).
Getting older, i became less used to face this weakness.
More information about the User
mailing list