Adding items in a list
Posted
#1
(In Topic #1391)
Regular

(I want the list-to-be-formed to be used later in another form, so the variable definitions are of type "Public".)
Code (gambas)
- MyOwnList.Add(A1)
- MyOwnList.Add(A2)
- MyOwnList.Add(A3)
The program halts here: MyOwnList.Add(A1) , displaying the diagnostic "not enough arguments".
When I change Collection to Collection[], it also halts with: "wanted Collection, got Boolean instead".
What is wrong?
(Of course, after a right execution, I suppose I 'd have two prints with "True".)
Posted
Guru

Code (gambas)
- MyOwnList.Add(A1)
- MyOwnList.Add(A2)
- MyOwnList.Add(A3)
Posted
Regular

I didn't know that lists can be of type array; thought they are only a collection of constants / variables, even of different types. (Hence, their definition as "Collection".)
Ok, I proceed with my program!
Posted
Guru

A Collection must always be pairs of KeyName and Data
1 guest and 0 members have just viewed this.


