[Gambas-user] drove me crazy

Charlie Reinl Karl.Reinl at ...2345...
Wed Jan 20 00:09:22 CET 2010


Salut Benoit,

its about Collection KEY and Debug-Window on gambas2.

If you run that project, and open col1 and col2 in a Debug-Window
(DBl-Click on the var), the Collection Key is always the last enumerated
element.

If you run it without Debug-Window or only col2 in a Debug-Window , the
Collection Key is the last read.

PUBLIC SUB Main()
DIM col1 AS NEW Collection
DIM col2 AS NEW Collection
DIM sElem AS String
DIM sKey AS String
  col1.Add("1", "one")
  col1.Add("2", "two")
  col1.Add("3", "three")
  col1.Add("4", "four")
  PRINT "Returns the key of the last read or last enumerated element. "
   FOR EACH sElem IN col1
      sKey = col1.Key
      PRINT sKey & " = " & sElem
      col2.Add(sElem, sKey)
   NEXT
END

see attached project.
-- 
Amicalement
Charlie

[OperatingSystem]
OperatingSystem=Linux
KernelRelease=2.6.24-26-generic
DistributionVendor=ubuntu
DistributionRelease="Ubuntu 8.04.3 LTS"

[System]
CPUArchitecture=i686
TotalRam=506932 kB

[Gambas]
Gambas1=gbx-1.0.17
Gambas1Path=/usr/bin/gbx

Gambas2=2.19.0                  rev.2613
Gambas2Path=/usr/local/bin/gbx2

Gambas3=2.99.0                  rev.2602 (can't compile actually)
Gambas3Path=/usr/local/bin/gbx3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: collTest-0.0.1.tar.gz
Type: application/x-compressed-tar
Size: 7613 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20100120/0af564b8/attachment.bin>


More information about the User mailing list