Re: [Gambas-user] Pre-release of Gambas 3.10.0

2017-07-22 Thread Benoît Minisini via Gambas-user

Le 22/07/2017 à 11:07, Christof Thalhofer a écrit :

Am 20.07.2017 um 22:49 schrieb Christof Thalhofer:


I will try it out at the weekend ... then I have time.


Next problem I found:

I have a query against a Postgresql function which returns the
postgresql type "date".

datum
---
  2012-10-01
  2012-11-01

If I query this in Gambas3 through a connection to the database and
iterate through the result:

For Each res
   str &= res!datum & gb.lf
Next
print str

In Gambas 3.9.99 I get:

10/01/2012 02:00:00
11/01/2012 02:00:00

In Gambas 3.9 stable I got:

10/01/2012
11/01/2012

(All my statistics with gnuplot are fucked up now ...)
(Yes I know, I should have to format the date)


Alles Gute

Christof Thalhofer



This is not a bug, this is a fix. The bug is in the behaviour of Gambas 
3.9 whose CStr() function - which is implicitely used in the line "str 
&= res!datum & gb.lf" - was incorrectly converting using localization, 
whereas CStr() must not be localization-aware (i.e. it must use UTC).


So the interpreter gets the date field contents from the database driver 
as a string.


Then is assumes that string to be a local date, and converts it accordingly.

Then CStr() converts that date back to a string, displaying it in UTC 
timezone (hence your two hours shift).


The actual problem is in the database drivers that always assume that 
dates stored in the database are local dates.


If your database dates are UTC (which should have been the default since 
the beginning, but fixing that would break the backward-compatibility), 
you have to write that:


MyDate = CDate(res!datum + System.TimeZone / 86400)

or

MyDate = Date.ToUTC(res!datum)

if you use the gb.util component from the latest revision.

Regards,

--
Benoît Minisini

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Pre-release of Gambas 3.10.0

2017-07-22 Thread Benoît Minisini via Gambas-user

Le 22/07/2017 à 10:38, Christof Thalhofer a écrit :

Am 20.07.2017 um 22:49 schrieb Christof Thalhofer:


I will try it out at the weekend ... then I have time.


I just tested Gambas daily, it does some weird thing with indentation in
the editor of the IDE when a string before an "If" goes over more than
one line.

I have installed:

3.9.90+svn8165+build3~ubuntu16.04.1

Attached there is a piece of code copied out of the editor. If you look at

"If msg Then"

This If has not the right indentation.

Alles Gute

Christof Thalhofer



That bug should have been fixed in revision #8166.

Regards,

--
Benoît Minisini

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Pre-release of Gambas 3.10.0 two confirme bug since 3.5 by Cristof

2017-07-22 Thread PICCORO McKAY Lenz
i confirme the two bugs of Christof:


> I just tested Gambas daily, it does some weird thing with indentation in
> the editor of the IDE when a string before an "If" goes over more than
> one line.

the "weird!" IDE line hanglind are since gambas 3.5, the line has some
strange behaviour..

1) when a string before an "If" goes over more than one line. if the
identation was set by user, when just push "intro" to make a new line, the
identation always goes to 2 spaces, and the user set identation are not
used.

2) when the ide has a large line that does not word wrap, the next last 8
chars of the line that are close to the limit of the screen are not showed,
user must push/move more chars to the right to show complete and discover
the left of the line, i mean if the line are too  large, in the limits of
the screen 8 chars are never showed

2017-07-22 4:37 GMT-04:30 Christof Thalhofer :

> I have a query against a Postgresql function which returns the
> postgresql type "date".
>

This its a well knowed "another bug" respect the databases support in
gambas, reported by me some time ago, i can't find where, but was before
new bugtraker , there many other .. due too much focus in mysql...

In Gambas 3.9.99 I get:
>
> 10/01/2012 02:00:00
> 11/01/2012 02:00:00
>
> In Gambas 3.9 stable I got:
>
> 10/01/2012
> 11/01/2012
>
> (All my statistics with gnuplot are fucked up now ...)
> (Yes I know, I should have to format the date)
>
>
> Alles Gute
>
> Christof Thalhofer
>
> --
> Dies ist keine Signatur
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Pre-release of Gambas 3.10.0

2017-07-22 Thread Christof Thalhofer
Am 20.07.2017 um 22:49 schrieb Christof Thalhofer:

> I will try it out at the weekend ... then I have time.

Next problem I found:

I have a query against a Postgresql function which returns the
postgresql type "date".

   datum
---
 2012-10-01
 2012-11-01

If I query this in Gambas3 through a connection to the database and
iterate through the result:

For Each res
  str &= res!datum & gb.lf
Next
print str

In Gambas 3.9.99 I get:

10/01/2012 02:00:00
11/01/2012 02:00:00

In Gambas 3.9 stable I got:

10/01/2012
11/01/2012

(All my statistics with gnuplot are fucked up now ...)
(Yes I know, I should have to format the date)


Alles Gute

Christof Thalhofer

-- 
Dies ist keine Signatur



signature.asc
Description: OpenPGP digital signature
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Pre-release of Gambas 3.10.0

2017-07-22 Thread Christof Thalhofer
Am 20.07.2017 um 22:49 schrieb Christof Thalhofer:

> I will try it out at the weekend ... then I have time.

I just tested Gambas daily, it does some weird thing with indentation in
the editor of the IDE when a string before an "If" goes over more than
one line.

I have installed:

3.9.90+svn8165+build3~ubuntu16.04.1

Attached there is a piece of code copied out of the editor. If you look at

"If msg Then"

This If has not the right indentation.

Alles Gute

Christof Thalhofer

-- 
Dies ist keine Signatur
' Gambas class file

Sub ShowBadIndentation()

  Dim msg as String
  
  If strusername = LocalSettings.Username And NoOwnDelete = False Then
msg = "This is first line" &
  "this is second"

  If msg Then
  Print "ahh thats wrong indentation"
End If
  End If

End


signature.asc
Description: OpenPGP digital signature
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user