[Gambas-bugtracker] Bug #2814: Shortcut += bugs with Collection object
bugtracker at gambaswiki.org
bugtracker at gambaswiki.org
Mon Oct 23 21:11:17 CEST 2023
http://gambaswiki.org/bugtracker/edit?object=BUG.2814&from=L21haW4-
Olivier CRUILLES reported a new bug.
Summary
-------
Shortcut += bugs with Collection object
Type : Bug
Priority : Medium
Gambas version : Master
Product : Development Environment
Description
-----------
Hello,
It appear the shotcut '+=' (equivalent of a = a + 1) does not work with Collection, it set a NULL instead of increase the content of the Collection
Example:
Public Sub Main()
Dim NewCollection As New Collection
Dim Index As Integer = 0
Dim i As Integer
NewCollection.Add(Index, "counter")
For i = 0 To 20
NewCollection["counter"] += 1 ' Does not work as expected -> NULL instead of 'counter + 1'
Print "Verif: NewCollection[\"counter\"] = " & NewCollection["counter"]
Next
Print " -------------------------------------------"
NewCollection["counter"] = 0
For i = 0 To 20
NewCollection["counter"] = NewCollection["counter"] + 1 ' This work as expecded
Print "Verif: NewCollection[\"counter\"] = " & NewCollection["counter"]
Next
End
===============================================
Résults:
Verif: NewCollection["counter"] = 0
Verif: NewCollection["counter"] = 0
Verif: NewCollection["counter"] = 0
Verif: NewCollection["counter"] =
Verif: NewCollection["counter"] =
Verif: NewCollection["counter"] =
Verif: NewCollection["counter"] =
Verif: NewCollection["counter"] =
Verif: NewCollection["counter"] =
Verif: NewCollection["counter"] =
Verif: NewCollection["counter"] =
Verif: NewCollection["counter"] =
Verif: NewCollection["counter"] =
Verif: NewCollection["counter"] =
Verif: NewCollection["counter"] =
Verif: NewCollection["counter"] =
Verif: NewCollection["counter"] =
Verif: NewCollection["counter"] =
Verif: NewCollection["counter"] =
Verif: NewCollection["counter"] =
Verif: NewCollection["counter"] =
-------------------------------------------
Verif: NewCollection["counter"] = 1
Verif: NewCollection["counter"] = 2
Verif: NewCollection["counter"] = 3
Verif: NewCollection["counter"] = 4
Verif: NewCollection["counter"] = 5
Verif: NewCollection["counter"] = 6
Verif: NewCollection["counter"] = 7
Verif: NewCollection["counter"] = 8
Verif: NewCollection["counter"] = 9
Verif: NewCollection["counter"] = 10
Verif: NewCollection["counter"] = 11
Verif: NewCollection["counter"] = 12
Verif: NewCollection["counter"] = 13
Verif: NewCollection["counter"] = 14
Verif: NewCollection["counter"] = 15
Verif: NewCollection["counter"] = 16
Verif: NewCollection["counter"] = 17
Verif: NewCollection["counter"] = 18
Verif: NewCollection["counter"] = 19
Verif: NewCollection["counter"] = 20
Verif: NewCollection["counter"] = 21
Thank you
olivier
System information
------------------
[System]
Gambas=3.18.90 72417abe7 (master)
OperatingSystem=Linux
Distribution=redhat Fedora release 38 (Thirty Eight)
Kernel=6.5.7-200.fc38.x86_64
Architecture=x86_64
Cores=8
Memory=32026M
Language=fr_FR.UTF-8
Desktop=MATE
DesktopResolution=92
DesktopScale=7
WidgetTheme=greybird
Font=Liberation Sans,10
[Programs]
appimage-builder=appimage-builder: 1.1.0
dpkg=Programme « dpkg » de gestion de paquets Debian version 1.21.21 (amd64).
gcc=gcc (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4)
git=git version 2.41.0
msgmerge=msgmerge (GNU gettext-tools) 0.21.1
rpmbuild=RPM version 4.18.1
[Libraries]
Cairo=libcairo.so.2.11708.0
Curl=libcurl.so.4.8.0
DBus=libdbus-1.so.3.32.4
GDK2=libgdk-x11-2.0.so.0.2400.33
GDK3=libgdk-3.so.0.2406.32
GStreamer=libgstreamer-1.0.so.0.2206.0
GTK+2=libgtk-x11-2.0.so.0.2400.33
GTK+3=libgtk-3.so.0.2406.32
OpenGL=libGL.so.1.7.0
QT5=libQt5Core.so.5.15.10
SQLite 3=libsqlite3.so.0.8.6
[Environment]
CAPP_BUILD=<home>/Packages/Starter/Build
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DEBUGINFOD_URLS=https://debuginfod.fedoraproject.org/
DESKTOP_SESSION=mate
DISPLAY=:0
EDITOR=/usr/bin/nano
FREETYPE_PROPERTIES=truetype:interpreter-version=35
GB_GUI=gb.gtk3
GDMSESSION=mate
GDM_LANG=fr_FR.UTF-8
GIO_LAUNCHED_DESKTOP_FILE_PID=1286395
GTK3_MODULES=xapp-gtk3-module
GTKM_INSERT_EMOJI=1
GTK_BACKDROP=1
GTK_FOCUS_VISIBLE=1
GTK_OVERLAY_SCROLLING=0
GTK_PROGRESS_TEXT_INSIDE=1
HISTCONTROL=ignoredups
HISTSIZE=1000
HISTTIMEFORMAT=%F %T
HOME=<home>
HOSTNAME=<hostname>
IMSETTINGS_INTEGRATE_DESKTOP=yes
IMSETTINGS_MODULE=none
KDEDIRS=/usr
LANG=fr_FR.UTF-8
LC_ALL=fr_FR.UTF-8
LESSOPEN=||/usr/bin/lesspipe.sh %s
LOGNAME=<user>
MAIL=/var/spool/mail/<user>
MANPAGER=less
MATE_DESKTOP_SESSION_ID=this-is-deprecated
PAGER=most
PATH=<home>/.local/bin:<home>/.cargo/bin:<home>/narwhal/bin:/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:<home>/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/var/lib/snapd/snap/bin:<home>/bin:/usr/local/xaralx/bin
PWD=<home>
QTDIR=/usr/lib64/qt-3.3
QTINC=/usr/lib64/qt-3.3/include
QTLIB=/usr/lib64/qt-3.3/lib
QT_FONT_DPI=93
QT_IM_MODULE=xim
QT_LOGGING_RULES=*.debug=false
QT_QPA_PLATFORMTHEME=gtk2
QT_SCALE_FACTOR=1
SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/10327,unix/unix:/tmp/.ICE-unix/10327
SHELL=/bin/bash
SHLVL=0
SSH_AGENT_PID=10490
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
TERM=dumb
TZ=:/etc/localtime
USER=<user>
XAUTHORITY=/run/lightdm/<user>/xauthority
XDG_CURRENT_DESKTOP=MATE
XDG_DATA_DIRS=<home>/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/<user>
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_CLASS=user
XDG_SESSION_DESKTOP=mate
XDG_SESSION_ID=2
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SESSION_TYPE=x11
XDG_VTNR=1
XMODIFIERS=@im=none
_=/usr/bin/mate-session
More information about the Bugtracker
mailing list