TGet bug?
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
TGet bug?
In TGet:LButtonUp() method there is
elseif Empty( cText ) .or. cText == " / /" .or. ;
AllTrim( cText ) == "0" .or. ;
AllTrim( cText ) == " - -"
but I think that cText can never be exactly equal to " / /" and surely AllTrim( cText ) can never be exactly equal to " - -".
EMG
elseif Empty( cText ) .or. cText == " / /" .or. ;
AllTrim( cText ) == "0" .or. ;
AllTrim( cText ) == " - -"
but I think that cText can never be exactly equal to " / /" and surely AllTrim( cText ) can never be exactly equal to " - -".
EMG
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Yes, but the exact comparison is with " / / " (note that it starts with a space).manuramos wrote:I think it's OK because ALLTRIM(" / / ") is exactly "/ /",
And here the exact comparison is with " - - " (note the leading and trailing spaces).manuramos wrote:in the same way ALLTRIM(" - - ") is exactly "- -", and is necesary.
EMG
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Enrico,
> cText == " / /"
It looks as an empty date (please notice that AllTrim() was not needed). There are two spaces before the first "/" and none after the last "/".
That seems to be the return from GetWindowText() when the date is empty. (edit: not sure about this, as a space may be typed after)
> cText == " / /"
It looks as an empty date (please notice that AllTrim() was not needed). There are two spaces before the first "/" and none after the last "/".
That seems to be the return from GetWindowText() when the date is empty. (edit: not sure about this, as a space may be typed after)
Last edited by Antonio Linares on Sun Feb 26, 2006 11:38 am, edited 1 time in total.
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Are you sure that GetWindowText() returns " / /" without the two trailing spaces? If yes then ok.Antonio Linares wrote:Enrico,
> cText == " / /"
It looks as an empty date (please notice that AllTrim() was not needed). There are two spaces before the first "/" and none after the last "/".
That seems to be the return from GetWindowText() when the date is empty.
EMG
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Enrico,
The problem is that if a PICTURE is used that has a "/" or a "-" in the front, then the code will be wrong, as ::nPos should not be set to 1.
This may be the right code:
What do you think ?
The problem is that if a PICTURE is used that has a "/" or a "-" in the front, then the code will be wrong, as ::nPos should not be set to 1.
This may be the right code:
Code: Select all
elseif Empty( cText ) .or. RTrim( cText ) == " / /" .or. ;
AllTrim( cText ) == "0" .or. ;
RTrim( cText ) == " - -"