[Gambas-user] Beware to revision #7983!

2016-11-18 Thread Benoît Minisini
Hi,

In revision #7983, I fixed a bug in date / string conversion, so that 
now, as it is logically expected:

CDate(CStr(CDate(2))) = CDate(2)

BEFORE:

$ gbx3 -e 'CStr(CDate(2))'
01/01/-4801 23:00:00
$ gbx3 -e 'CStr(CDate(CStr(CDate(2'
00/00/ 23:00:00
$ gbx3 -e 'CDate(CStr(CDate(CStr(CDate(2)'
Type mismatch: wanted Date, got String instead

AFTER:

$ gbx3 -e 'CStr(CDate(2))'
01/02/-4801
$ gbx3 -e 'CStr(CDate(CStr(CDate(2'
01/02/-4801
$ gbx3 -e 'CDate(CStr(CDate(CStr(CDate(2)'
01/01/-4801 23:00:00

(Note: The last line is displayed as a local date/time.)

It was not the case before, because the conversion were internally done 
by taking the timezone into account, even if date/time values are 
internally stored in UTC.

Now CDate() on a string always interpret it as an UTC date, and CStr() 
on a date displays its UTC value.

Consequently, check your code!

CStr() and CDate() are not supposed to use a local time representation. 
On the contrary. This is the job of Val(), Str() and Format().

If you wrote code that made that assumption, you did wrong.

BEWARE! BEWARE! BEWARE!

-- 
Benoît Minisini

--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] DBusSignal Error (Send)

2016-11-18 Thread Hans Lehmann

Am 17.11.2016 um 02:20 schrieb zainudin ahmad:

Hi Hans, I hope this work for you:)  (project attach)


Yes, that has solved it!
The new code in the attached project 'signalsend-0.1.82.tar.gz' is 
correct. It works fine.


Hans
--
Author of the german Gambas book
gambas-buch.de/dw/doku.php




signalsend-0.1.82.tar.gz
Description: application/gzip
--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] DBusSignal Error (Send)

2016-11-18 Thread Benoît Minisini
Le 14/11/2016 à 18:00, Hans Lehmann a écrit :
> Hello,
>
> in my project 'signaltx2' I get after this source line:
>
> DBus[DBus.Name].Raise(NameVersion, "GetGBVersion", ["3.9.1"])
>
> the following error message:
>
> Couldn't allocate D-Bus message !
>
> Where is the error in the source code? Can someone help?
> Project attached.
>
> Sincerely
>
> Hans
>

It should behave better with revision #7984.

The problem was in the event name. You didn't specified the event 
interface, and so you got a crash.

Now, when no interface is specified in the event name, the default 
interface of the object is used.

Thus:

DBus[$sDBusService].Raise($hDBusObject, "GetGBVersion", ["3.9.1"])

is replaced by:

DBus[$sDBusService].Raise($hDBusObject, 
"org.gambas.signaltx2.nameversion.GetGBVersion", ["3.9.1"])

Regards,

-- 
Benoît Minisini

--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] gb.util GenUUID() function

2016-11-18 Thread Karl Reinl
Am Donnerstag, den 17.11.2016, 10:49 +1030 schrieb adamn...@gmail.com:
> Every now and then I come across a need for a (locally) unique ID. Shelling 
> the ubiquitous gnu "uuidgen (-t/-r)" utility usually handles this effectively 
> enough. However, I am thinking that maybe this is a possible candidate for 
> the gb.util component.  
> In particular, most often times I am looking for the string representation of 
> the UID. In which case "SHELL uuidgen TO $somevar" is all that is required.  
> On the other hand, and on somewhat rarer occasions, I need the binary rep of 
> the generated UID. Now "uuid_parse" can handle that ... and some years ago 
> (gb2) I had a bit of code that could call that routine, sadly now long lost. 
> 
> Anyway, if there is any interest in this, as an enhancement to gb.util I'll 
> spend some effort trying to find that old code and adding it to the gb.util 
> component. I'm thinking about two new functions here 
> a) "GenUUID" with optional params to force the -t/-r options which would just 
> shell the uuidgen utility and return the string representation and
> b) "GenUUIDBinary" that would return the binary version.
> 
> Any thoughts?
> B
> 
> 

Salut B,

I use the attached (now on gambas3 as library) uuidgen since 12 year
now, works pretty simple and never failed since.
I use it in a CRM DB as PK in every table.



-- 
Amicalement
Charlie


uuidgen-0.3.13.tar.gz
Description: application/compressed-tar
--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1033: Interpreter Crash when delete directory from file-chooser control

2016-11-18 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1033&from=L21haW4-

Zainudin AHMAD reported a new bug.

Summary
---

Interpreter Crash when delete directory from file-chooser control

Type : Bug
Priority : Medium
Gambas version   : 3.9.90 (TRUNK)
Product  : GUI components


Description
---

Interpreter Crash when deleting directory from file-chooser control

Reproduce the bug:
1) Run project (attach project)
3) Remove Test-DelteMe directory.(attach pic-1)
4) when message box shows, click the delete button.

This happen with GTK2, GTK3, QT4, QT5 and if the project using gb.inotify 
component. 
it's fine with Gambas 3.8.4 (because no delete fiture)


System information
--

[System]
Gambas=3.9.90 r7969
OperatingSystem=Linux
Kernel=4.4.0-28-generic
Architecture=x86
Distribution=Ubuntu 16.04.1 LTS
Desktop=LXQT
Theme=Gtk
Language=en_US.UTF-8
Memory=492M

[Libraries]
Cairo=libcairo.so.2.11400.6
Curl=libcurl.so.4.4.0
DBus=libdbus-1.so.3.14.6
GStreamer=libgstreamer-1.0.so.0.802.0
GTK+2=libgtk-x11-2.0.so.0.2400.30
GTK+3=libgtk-3.so.0.1800.9
OpenGL=libGL.so.1.2.0
Poppler=libpoppler.so.19.0.0
Poppler=libpoppler.so.58.0.0
QT4=libQtCore.so.4.8.7
QT5=libQt5Core.so.5.5.1
SDL=libSDL-1.2.so.0.11.4
SQLite=libsqlite3.so.0.8.6

[Environment]
BROWSER=
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-MI168mGbvA,guid=b9d730fb142add9297a954bd582a8405
DEFAULTS_PATH=/usr/share/gconf/lxqt.default.path
DESKTOP_SESSION=lxqt
DISPLAY=:0
GB_GUI=gb.qt4
GDMSESSION=lxqt
GDM_LANG=en
GTK_CSD=0
HOME=
LANG=en_US.UTF-8
LANGUAGE=en
LC_ADDRESS=id_ID.UTF-8
LC_IDENTIFICATION=id_ID.UTF-8
LC_MEASUREMENT=id_ID.UTF-8
LC_MONETARY=id_ID.UTF-8
LC_NAME=id_ID.UTF-8
LC_NUMERIC=id_ID.UTF-8
LC_PAPER=id_ID.UTF-8
LC_TELEPHONE=id_ID.UTF-8
LC_TIME=id_ID.UTF-8
LOGNAME=
LXQT_SESSION_CONFIG=session
MANDATORY_PATH=/usr/share/gconf/lxqt.mandatory.path
PAM_KWALLET5_LOGIN=/tmp/kwallet5_.socket
PAPERSIZE=a4
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PWD=
QT_ACCESSIBILITY=1
QT_IM_MODULE=compose
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
QT_PLATFORM_PLUGIN=lxqt
QT_QPA_PLATFORMTHEME=lxqt
SAL_USE_VCLPLUGIN=kde4
SHELL=/bin/bash
SHLVL=0
SSH_AGENT_PID=2323
SSH_AUTH_SOCK=/tmp/ssh-OOryOWWumXur/agent.2271
TERM=qterminal
TZ=:/etc/localtime
USER=
XAUTHORITY=/.Xauthority
XDG_CACHE_HOME=/.cache
XDG_CONFIG_DIRS=/etc/xdg/xdg-lxqt:/etc/xdg
XDG_CONFIG_HOME=/.config
XDG_CURRENT_DESKTOP=LXQt
XDG_DATA_DIRS=/usr/share/lxqt:/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop:/.local/share:/usr/share
XDG_DATA_HOME=/.local/share
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/
XDG_MENU_PREFIX=lxqt-
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_DESKTOP=lxqt
XDG_SESSION_ID=c2
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SESSION_TYPE=x11
XDG_VTNR=7



--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1033: Interpreter Crash when delete directory from file-chooser control

2016-11-18 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1033&from=L21haW4-

Zainudin AHMAD added an attachment:

Bug-segf-FileChooserDelete-0.0.1.tar.gz



--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1033: Interpreter Crash when delete directory from file-chooser control

2016-11-18 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1033&from=L21haW4-

Zainudin AHMAD added an attachment:

pic-1.png



--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] gb.util GenUUID() function

2016-11-18 Thread Fabien Bodard
if there is only one function in your class ... why don't you use the
_Call special function ?

So you can use it like :

uuidgen(...)

2016-11-19 0:16 GMT+01:00 Karl Reinl :
> Am Donnerstag, den 17.11.2016, 10:49 +1030 schrieb adamn...@gmail.com:
>> Every now and then I come across a need for a (locally) unique ID. Shelling 
>> the ubiquitous gnu "uuidgen (-t/-r)" utility usually handles this 
>> effectively enough. However, I am thinking that maybe this is a possible 
>> candidate for the gb.util component.
>> In particular, most often times I am looking for the string representation 
>> of the UID. In which case "SHELL uuidgen TO $somevar" is all that is 
>> required.  On the other hand, and on somewhat rarer occasions, I need the 
>> binary rep of the generated UID. Now "uuid_parse" can handle that ... and 
>> some years ago (gb2) I had a bit of code that could call that routine, sadly 
>> now long lost.
>>
>> Anyway, if there is any interest in this, as an enhancement to gb.util I'll 
>> spend some effort trying to find that old code and adding it to the gb.util 
>> component. I'm thinking about two new functions here
>> a) "GenUUID" with optional params to force the -t/-r options which would 
>> just shell the uuidgen utility and return the string representation and
>> b) "GenUUIDBinary" that would return the binary version.
>>
>> Any thoughts?
>> B
>>
>>
>
> Salut B,
>
> I use the attached (now on gambas3 as library) uuidgen since 12 year
> now, works pretty simple and never failed since.
> I use it in a CRM DB as PK in every table.
>
>
>
> --
> Amicalement
> Charlie
>
> --
>
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



-- 
Fabien Bodard

--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user