Page 1 of 2
DateTime Error
Posted: Tuesday 12th March 2019 11:40pm
by Quincunxian
I had this error and want to confirm that its not just me.
Can someone else please try this with a DateTime box; if it is a real bug, I'll log it formally.
DateTimeBox.Value = CDate("01/01/2019")
Returns an error even though both are date Types.
Error returned is : "Type mismatch: Wanted Date , got string instead."
Gambas=3.12.90
OperatingSystem=Linux
Kernel=4.15.0-46-generic
Architecture=x86_64
Distribution=Ubuntu 18.04.2 LTS
Desktop=UBUNTU:GNOME
Theme=Gtk
Language=en_AU.UTF-8
Re: DateTime Error
Posted: Wednesday 13th March 2019 5:05am
by Got2BeFree
Where are you getting a DateTime box? The only thing I can find is a ValueBox with the type set to DateTime. Maybe I'm missing a component that has that?
Re: DateTime Error
Posted: Wednesday 13th March 2019 6:01am
by Quincunxian
Hey Sholzy,
Got actual control name wrong.....
DateBox (gb.form)
This control allows to edit a date value. It provides a little button that displays a calendar popup.
Edit: in the 'Chooser' tab.
Re: DateTime Error
Posted: Wednesday 13th March 2019 9:59am
by gambix
You must to share more code to allow us to understand your error. Tested here without problem.
Also the date must be in us style mm/dd/yyyy. in other case it return the message you have
I can just say the pb is around your use of CDate
Re: DateTime Error
Posted: Wednesday 13th March 2019 10:24am
by stevedee
Quincunxian wrote: ↑Tuesday 12th March 2019 11:40pm
I had this error and want to confirm that its not just me.
Can someone else please try this with a DateTime box; if it is a real bug, I'll log it formally...
No, it seems to work as expected for me on 3.12.90 (...and on 3.12.2).
The error message: "Type mismatch: Wanted Date , got string instead."
...is a funny one, because I often see this when the error is unrelated to this description (its almost like a fall-back error).
Edit: I'm running 3.12.90 on Lubuntu 18.10 with that new LXQt desktop
Re: DateTime Error
Posted: Wednesday 13th March 2019 11:23am
by Cedron
I did this in a Form_Open():
Dim d As DateBox
d = New DateBox(Me)
d.Value = CDate("01/01/2019")
Print d.Value
d.X = 100
d.Y = 100
d.W = 100
d.H = 20
d.Show()
I got this in the console:
The date was also 12/31/2018 on the form.
Looks like a bug to me.
It also raises the question, how does one place a Form control on the form at design time if it isn't in one of the panels to the right?
Ced
3.12.2 (Behind the front lines.)
Re: DateTime Error
Posted: Wednesday 13th March 2019 11:41am
by cogier
I tried this and it works as expected. Is this a language problem?
I am using en_GB.UTF-8 (British)
Stevedee en_GB.UTF-8 (British) - I presume
Quincunxian en_AU.UTF-8 (Austrailia)
Cedron en_US.UTF-8 (USA) - I presume
Sholzy en_US.UTF-8 (USA) - I presume
Just a thought!
Re: DateTime Error
Posted: Wednesday 13th March 2019 11:41am
by jornmo
@Cedron .Move() does what you four lines did in one
http://gambaswiki.org/wiki/comp/gb.qt4/control/move
Re: DateTime Error
Posted: Wednesday 13th March 2019 11:45am
by cogier
@Cedron .Move() does what you four lines did in one
I did not need either the following worked fine: -
Public Sub Form_Open()
Dim d As DateBox
d = New DateBox(Me)
d.Value = CDate("01/01/2019")
Print d.Value
End
Re: DateTime Error
Posted: Wednesday 13th March 2019 11:58am
by jornmo
cogier wrote: ↑Wednesday 13th March 2019 11:45am
I did not need either the following worked fine: -
Sure, but that's another story