[Gambas-user] array of object is SO needed

Jussi Lahtinen jussi.lahtinen at gmail.com
Tue Mar 31 20:20:49 CEST 2020


You can even use array of labels...


Jussi

On Tue, Mar 31, 2020 at 1:22 PM roberto <roberto.premoli at tiscali.it> wrote:

> 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.
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200331/b955288c/attachment.html>


More information about the User mailing list