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 » LineEdit, EditFields, DocEdit » NotNull not working with custom SetConvert [CLOSED]
NotNull not working with custom SetConvert [CLOSED] [message #54757] Mon, 07 September 2020 20:40 Go to next message
Pradip is currently offline  Pradip
Messages: 71
Registered: February 2019
Location: India
Member
Hi there,

Trying to have an EditDate with custom setconvert with the following struct:

struct ConvWorkDay : ConvertDate {
	ConvWorkDay() {NotNull();};
	virtual Value Scan(const Value& text) const;
};

Hoping that the EditDate won't allow null value. This worked in previous version, but not now.

Any help please?


Regards,
Pradip

[Updated on: Tue, 08 September 2020 07:43]

Report message to a moderator

Re: NotNull not working with custom SetConvert [CLOSED] [message #54759 is a reply to message #54757] Tue, 08 September 2020 07:42 Go to previous message
Pradip is currently offline  Pradip
Messages: 71
Registered: February 2019
Location: India
Member
Sorry! I screwed up! Embarassed

The commented line caused all that trouble

Value ConvWorkDay::Scan(const Value& text) const {
	DUMP("ConvWorkDay::Scan");
//	if(text.IsNull()) return Null;

	Value v = ConvertDate::Scan(text);
	if(v.IsError()) return v;
	
	Date d = v;
	if(IsHoliday(d)) return ErrorValue("Cannot be a holiday!");
	return v;
}


Regards,
Pradip
Previous Topic: How to toggle on/off word wrap in LineEdit/DocEdit?
Goto Forum:
  


Current Time: Sun Sep 27 23:13:21 CEST 2020

Total time taken to generate the page: 0.01258 seconds