Re: [fpc-pascal] TMaskUtils.ValidateInput function: how is it supposed to behave?

2016-04-28 Thread Bart
On 4/18/16, Michael Van Canneyt wrote: > I think Bart meant that the maskutils unit should simply use unicodestring. > Given that it almost surely will need to deal with $ and € etc, that seems > like a better approach. FWIW an unicode version for testing attached. Bart

Re: [fpc-pascal] TMaskUtils.ValidateInput function: how is it supposed to behave?

2016-04-19 Thread Bart
On 4/18/16, Luiz Americo Pereira Camara wrote: > I propose to write a test suite first with the desired output, based on > Delphi. > I agree with the concept, but: Please note that Delphi (AFAICS) does not have a TMaskUtils class. The behaviour of TMaskEdit (and hence

Re: [fpc-pascal] TMaskUtils.ValidateInput function: how is it supposed to behave?

2016-04-18 Thread Graeme Geldenhuys
On 2016-04-18 19:26, Luiz Americo Pereira Camara wrote: > I propose to write a test suite first with the desired output, based on > Delphi. Fantastic idea! Test Driven Development - the best way to write any software. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using

Re: [fpc-pascal] TMaskUtils.ValidateInput function: how is it supposed to behave?

2016-04-18 Thread Michael Van Canneyt
On Mon, 18 Apr 2016, Luiz Americo Pereira Camara wrote: 2016-04-18 13:47 GMT-03:00 Bart : [..] The internal processing of the (edit)mask is the same as TMaskEdit. If that is broken somehow, it is also broken in TMaskEdit. The only functions that may need adjustments

Re: [fpc-pascal] TMaskUtils.ValidateInput function: how is it supposed to behave?

2016-04-18 Thread Luiz Americo Pereira Camara
2016-04-18 13:47 GMT-03:00 Bart : [..] > The internal processing of the (edit)mask is the same as TMaskEdit. > If that is broken somehow, it is also broken in TMaskEdit. > > The only functions that may need adjustments are > > * function FormatMaskText(const EditMask:

Re: [fpc-pascal] TMaskUtils.ValidateInput function: how is it supposed to behave?

2016-04-18 Thread Bart
On 4/18/16, Michael Van Canneyt wrote: > I think Bart meant that the maskutils unit should simply use unicodestring. > Given that it almost surely will need to deal with $ and € etc, that seems > like a better approach. Yep. In UTF8 the 1 on 1 relation between the

Re: [fpc-pascal] TMaskUtils.ValidateInput function: how is it supposed to behave?

2016-04-18 Thread Michael Van Canneyt
On Mon, 18 Apr 2016, Graeme Geldenhuys wrote: On 2016-04-18 15:51, Bart wrote: Maybe a version of maskutils unit based on UnicodeString should also be made? This seems so redundant. I still need to study the new FPC 3.0 string handling, but I was hoping such duplication of implementations

Re: [fpc-pascal] TMaskUtils.ValidateInput function: how is it supposed to behave?

2016-04-18 Thread Graeme Geldenhuys
On 2016-04-18 15:51, Bart wrote: > Maybe a version of maskutils unit based on UnicodeString should also > be made? This seems so redundant. I still need to study the new FPC 3.0 string handling, but I was hoping such duplication of implementations would not be necessary with newer FPC versions.

Re: [fpc-pascal] TMaskUtils.ValidateInput function: how is it supposed to behave?

2016-04-18 Thread Bart
On 4/18/16, Bart wrote: >> I recently did some work on it; the class works completely wrong IMO, and As a side note: function ValidateInput : string; The function raises an exception upon failure. Since we did not have to follow Delphi here, a better declaration IMHO

Re: [fpc-pascal] TMaskUtils.ValidateInput function: how is it supposed to behave?

2016-04-18 Thread Bart
On 4/18/16, Michael Van Canneyt wrote: > I recently did some work on it; the class works completely wrong IMO, and I > though to replace it completely with the functions found in the LCL. Yep, I was going that way too (and started coding it so). Currently FormatMaskText

Re: [fpc-pascal] TMaskUtils.ValidateInput function: how is it supposed to behave?

2016-04-18 Thread Michael Van Canneyt
On Sun, 17 Apr 2016, Bart wrote: Hi, I cannot find any documentation about TMaskUtils.ValidateInput function (unit MaskUtils). AFAICS Delphi does not have such a class? (ref: http://docwiki.embarcadero.com/Libraries/XE6/en/System.MaskUtils) There are some bugreports about this unit in

[fpc-pascal] TMaskUtils.ValidateInput function: how is it supposed to behave?

2016-04-17 Thread Bart
Hi, I cannot find any documentation about TMaskUtils.ValidateInput function (unit MaskUtils). AFAICS Delphi does not have such a class? (ref: http://docwiki.embarcadero.com/Libraries/XE6/en/System.MaskUtils) There are some bugreports about this unit in Mantis which got me interested. See the