Blank date with inputWindow()

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
karweru
Posts: 220
Joined: Fri Aug 01, 2008 1:51 pm
DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
Contact:

Blank date with inputWindow()

Post by karweru »

Hi Friends,

Is there anyway to force inputWindow() to default to a blank date, instead of to the current date?
Kind regards,
Gilbert.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Blank date with inputWindow()

Post by Pablo César »

Hi Gilbert !

Thank you for your interest in InputWindow and you have raised this subject about blank dates.

I have a solution but before I reveal how to do it, let make a question:

How do you do for DatePickers ? (and give an example in case)

Because we know in DatePickers only accepts date data as value. HMG and as many other programming languages does just to keeping the same restrintions for many reasons. One is because blank is not a date data.

This is a very good matter to be discussed and this it would be a good chance to care a publicate the trick for this question...

Because InputWindow, uses HMG controls and is part of it core.

B.Rgds.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
karweru
Posts: 220
Joined: Fri Aug 01, 2008 1:51 pm
DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
Contact:

Re: Blank date with inputWindow()

Post by karweru »

Hi Pablo,

I actually have not achieved a 'blank date" with datepicker control.

I've been trying to use inputWindow() to querry databases,...i usually scan the result and drop off fields that are empty. Since date is never empty, i've never allowed a querry on date fields which obviously is a great inconvinience.

In the example attached, the initial value fed to the date field is ctod("//") which essentially gives a blank date field.

demo.rar
(634 Bytes) Downloaded 165 times
Kind regards,
Gilbert.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Blank date with inputWindow()

Post by Pablo César »

karweru wrote:I actually have not achieved a 'blank date" with datepicker control.
Hi Gilbert, thanks to reply with sample and to be questioned about this. Because what is seems not posible empty values as dates at DatePickers would can say also not posible in InputWindow which uses the same HMG controls too.

But this will become a great oportunity to reveal a good trick that not requires any fixing at our HMG library however requires a simple configuration at your source code to get this so desired effect. :ugeek:

Please read this just prepared topic to solve blank dates at DatePickers.

Then we can say this will be also posible in InputWindow too, by accepting FORMAT property and will be ready for all at next HMG release version. :P

So at next version you will just correct your code like this:
Screen3.png
Screen3.png (27.72 KiB) Viewed 3063 times
Best regards and enjoy HMG power ! :D
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
karweru
Posts: 220
Joined: Fri Aug 01, 2008 1:51 pm
DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
Contact:

Re: Blank date with inputWindow()

Post by karweru »

Hi Pablo,

I've made the changes but i can't get a blank date.
Kind regards,
Gilbert.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Blank date with inputWindow()

Post by Pablo César »

karweru wrote:I've made the changes but i can't get a blank date.
Gilbert, you mean was not succesfull to get blank dates at DatePickers ? As I been indicated at this topic or not got at InputWindow with actual version ?

You did understood me. I said:
Pablo César wrote:will be also posible in InputWindow too, by accepting FORMAT property and will be ready for all at next HMG release version.

So at next version you will just correct your code like this
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
karweru
Posts: 220
Joined: Fri Aug 01, 2008 1:51 pm
DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
Contact:

Re: Blank date with inputWindow()

Post by karweru »

Thanks Pablo,

I got it now, I was so excited i didn't read carefully about inputwindow(). It works with datepicker of course. Thanks so much,...will wait for next version. Many thanks for your good work.
Kind regards,
Gilbert.
Post Reply