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 » Community » Newbie corner » how to make an editfield accept only number or date? have any examples in the documentation?
Re: how to make an editfield accept only number or date? have any examples in the documentation? [message #55004 is a reply to message #54996] Sun, 04 October 2020 17:01 Go to previous messageGo to previous message
BetoValle is currently offline  BetoValle
Messages: 204
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
Hi,

see:
... fld.SetConvert(DateIntConvert());
...struct DateIntConvertCls : Convert {
virtual Value Format(const Value& q) const;
virtual Value Scan(const Value& text) const;
virtual int Filter(int chr) const;
};
...Convert& DateIntConvert() {return Single<DateIntConvertCls>(); }
.....

Value DateIntConvertCls::Format(const Value& q) const
{
Date d = Date(1970, 1, 1) + q;
LOG("in format" << "=" << d);
return IsNull(q) ? String() : ::Format(Date(1970, 1, 1) + (int)q);
}

if i want show in "LOG" convert d to a string within

... String s = Format(d); //(*)
... LOG("in format" << "=" << s );

an exception occurs and the test application aborts silently.
If Format (*) returns a String, what would be the problem / inspection?

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon14.gif
Previous Topic: sqlarray and sqlite
Next Topic: How to load your GridCtrl in background thread
Goto Forum:
  


Current Time: Sun Aug 24 09:49:23 CEST 2025

Total time taken to generate the page: 0.04543 seconds