[Gambas-bugtracker] Bug #1742: Add an optional message to the Stop command

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Sun Mar 1 06:20:55 CET 2020


http://gambaswiki.org/bugtracker/edit?object=BUG.1742&from=L21haW4-

Bruce BRUEN reported a new bug.

Summary
-------

Add an optional message to the Stop command

Type             : Request
Priority         : Medium
Gambas version   : 3.14
Product          : Unknown


Description
-----------

This is just a shortcut to save having to include Print/Error commands just before the stop.

During development, I frequently leave unresolved error conditions hanging around with Stop's in them as I might be focussing on some other part of the code. These are usually the error conditions that don't happen often, such as I'm processing a large set of records with some complex code, maybe one record in the set has a null value that I haven't figured out what to do about yet as I'm looking at some other aspect of the processing....

So,
  If not CurrentTransaction.Taxable Then Stop "Tax flag is null"
is a lot more concise than
  If not CurrentTransaction.Taxable Then
    Print "Tax flag is null"
    Stop
  Endif

(Especially in the middle of a complex set of if..elses)

and this is the important bit...
would immediately take my mind to the problem rather than having to think about what caused the Stop.
Also the reason for the stop might (and sometimes does) occur somewhere else..  so

  If sFault then Stop sFault

where sFault is a message set nowhere near where the Stop command is in the code....

regards
B


System information
------------------

[System]
Gambas=3.11.90 d3c17c791 (local)
OperatingSystem=Linux
Kernel=4.16.13-pclos1
Architecture=x86_64
Distribution=PCLinuxOS
Desktop=MATE
Theme=Gtk
Language=en_US.UTF-8
Memory=7491M

[Libraries]

[Environment]
BROWSER=/usr/bin/www-browser
CANBERRA_DRIVER=pulse
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-tYSAEsKmJW,guid=084be9baa369436402ea749d5bebea13
DESKTOP_SESSION=05MATE
DISPLAY=:0
GB_GUI=gb.qt4
GCONF_TMPDIR=/tmp
GDMSESSION=05MATE
GDM_XSERVER_LOCATION=local
GIO_LAUNCHED_DESKTOP_FILE=<home>/Desktop/projectbrowser5.desktop
GIO_LAUNCHED_DESKTOP_FILE_PID=16405
GIT_PAGER=less -FRS
GNOME_KEYRING_CONTROL=<home>/.cache/keyring-787ASZ
GTK2_RC_FILES=<home>/.gtkrc-2.0
GTK_MODULES=canberra-gtk-module
GTK_OVERLAY_SCROLLING=0
G_FILENAME_ENCODING=@locale
HISTCONTROL=ignoredups
HISTSIZE=1000
HOME=<home>
HOSTNAME=<hostname>
INPUTRC=/etc/inputrc
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_COLLATE=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_SOURCED=1
LC_TELEPHONE=en_US.UTF-8
LC_TIME=en_US.UTF-8
LD_LIBRARY_PATH=:/usr/lib64:/usr/lib
LESS=-MM
LESSCHARSET=utf-8
LESSKEY=/etc/.less
LESSOPEN=|/usr/bin/lesspipe.sh %s
LOGNAME=<user>
LS_COLORS=
MAIL=/var/spool/mail/<user>
MATE_DESKTOP_SESSION_ID=this-is-deprecated
MDV_MENU_STYLE=discovery
META_CLASS=desktop
NLSPATH=/usr/share/locale/%l/%N
PATH=/bin:/usr/bin:/usr/local/bin:/usr/games:/usr/lib64/qt4/bin:/usr/lib64/qt5/bin:<home>/bin:/sbin:/usr/sbin
PWD=<home>
PYTHONDONTWRITEBYTECODE=1
PYTHONSTARTUP=/etc/pythonrc.py
QT4DOCDIR=/usr/share/doc/qt4
QT5DOCDIR=/usr/share/doc/qt5
QTDIR=/usr/lib64/qt4
QTDIR5=/usr/lib64/qt5
QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_SCALE_FACTOR=1
SESSION_MANAGER=local/<hostname>:@/tmp/.ICE-unix/29853,unix/<hostname>:/tmp/.ICE-unix/29853
SHELL=/bin/bash
SHLVL=1
SSH_AGENT_PID=29892
SSH_AUTH_SOCK=<home>/.cache/keyring-787ASZ/ssh
TMP=/tmp/
TMPDIR=/tmp/
TZ=:/etc/localtime
USER=<user>
WINDOWPATH=8
XAUTHORITY=<home>/.Xauthority
XDG_CONFIG_DIRS=/etc/xdg/mate:/etc/xdg/discovery:/etc/xdg
XDG_CURRENT_DESKTOP=MATE
XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/
XDG_SESSION_COOKIE=<hostname>-1542187537.274074-1876948711
XMODIFIERS=@im=none
_=/usr/bin/gambas3




More information about the Bugtracker mailing list