[Gambas-user] Collection key

Caveat Gambas at ...1950...
Wed Oct 12 21:42:22 CEST 2011


And the other way around...as you also talked about "the last 8
characters"...
  DIM coll AS NEW Collection
  DIM value AS String
  coll.Add("A", "A12345678")
  coll.Add("B", "B12345678")
  coll.Add("C", "C12345678")
  coll.Add("D", "12345678")
  FOR EACH value IN coll
    PRINT "Value: " & value & "   Key: " & coll.key & "   Value of
coll[" & coll.key & "] : " & coll[coll.key] 
  NEXT

Value: A   Key: A12345678   Value of coll[A12345678] : A
Value: B   Key: B12345678   Value of coll[B12345678] : B
Value: C   Key: C12345678   Value of coll[C12345678] : C
Value: D   Key: 12345678   Value of coll[12345678] : D

On Wed, 2011-10-12 at 21:37 +0200, Caveat wrote:
> DIM coll AS NEW Collection
>   DIM value AS String
>   coll.Add("A", "12345678A")
>   coll.Add("B", "12345678B")
>   coll.Add("C", "12345678C")
>   coll.Add("D", "12345678")
>   FOR EACH value IN coll
>     PRINT "Value: " & value & "   Key: " & coll.key & "   Value of
> coll[" & coll.key & "] : " & coll[coll.key] 
>   NEXT
> 
> I don't get what the problem is.  In both Gambas2 and Gambas3 I get the
> expected result: 
> 
> Value: A   Key: 12345678A   Value of coll[12345678A] : A
> Value: B   Key: 12345678B   Value of coll[12345678B] : B
> Value: C   Key: 12345678C   Value of coll[12345678C] : C
> Value: D   Key: 12345678   Value of coll[12345678] : D
> 
> Am I missing the obvious here, or is this affecting only a certain
> version of Gambas or a specific platform?
> 
> Kind regards,
> Caveat
> 
> 
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2d-oct
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user






More information about the User mailing list