Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Date Scan Problem
Date Scan Problem [message #14094] Sun, 10 February 2008 22:18 Go to next message
zsolt is currently offline  zsolt
Messages: 697
Registered: December 2005
Location: Budapest, Hungary
Contributor
The problem is, that
Value Scan(dword qtype, const String& text)
has changed, to allow only spaces after the date, but in standard Hungarian date format, there is an ending dot ('.') after date.

The Hungarian date format is "YYYY.MM.DD.", so the valid dates are not valid according to the scan function.

The code in Scan function:
	case DATE_V:
		if(text.IsEmpty()) return (Date) Null;
		s = StrToDate(date, text);
		if(s) {
			while(*s == ' ') s++;
			if(*s == '\0')
				return date;
		}
		return ErrorValue(t_("Invalid date !"));

I don't know the theory behind the new behaviour of Scan(), but is it possible to change it to a usable implementation?
Re: Date Scan Problem [message #14099 is a reply to message #14094] Mon, 11 February 2008 08:24 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, it was changed based on this:

http://www.ultimatepp.org/forum/index.php?t=msg&goto=131 98&&srch=Date#msg_13198

Anyway, looks like we should rather test there are no more digits, that should be enough, correct?

Mirek
Re: Date Scan Problem [message #14100 is a reply to message #14099] Mon, 11 February 2008 08:27 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, does this sound better?

	case DATE_V:
		if(text.IsEmpty()) return (Date) Null;
		s = StrToDate(date, text);
		if(s)
			for(;;) {
				if(IsDigit(*s))
					break;
				if(*s == '\0')
					return date;
				s++;
			}
		return ErrorValue(t_("Invalid date !"));
Re: Date Scan Problem [message #14103 is a reply to message #14100] Mon, 11 February 2008 08:55 Go to previous message
zsolt is currently offline  zsolt
Messages: 697
Registered: December 2005
Location: Budapest, Hungary
Contributor
luzr wrote on Mon, 11 February 2008 08:27

OK, does this sound better?

	case DATE_V:
		if(text.IsEmpty()) return (Date) Null;
		s = StrToDate(date, text);
		if(s)
			for(;;) {
				if(IsDigit(*s))
					break;
				if(*s == '\0')
					return date;
				s++;
			}
		return ErrorValue(t_("Invalid date !"));



Yes, thanks.
Previous Topic: Serious bug in String comparison or weird feature?
Next Topic: [BUG] Ctrl::AlignRight
Goto Forum:
  


Current Time: Mon Apr 29 02:42:21 CEST 2024

Total time taken to generate the page: 0.03766 seconds