Notes |
(0016070)
Boguslaw Brandys (reporter)
2007-11-11 18:14
|
Updated archive.Added console fpcunit tests also. |
|
(0016072)
Boguslaw Brandys (reporter)
2007-11-11 20:23
|
Fixed some bugs.
Warning: This function will not be totally compatible with buggy delphi behaviour! It should be rather compatible with some useful but unimplemented (by delphi) features.
For example this test:
AssertEquals('123-45-6789',FormatMaskText('000\-00\-0000;1;_','123-45-6789'));
is correct under lazarus now, because all literals in value match literals in mask (i.e. total value match mask), and this :
FormatMaskText('000\-00\-0000;1;_','123456789')); will raise exception under lazarus as opposite to delphi !
also :
FormatMaskText('>ccc;0;?','kerry NEIGHBOUR and 10') returns now:
'KERRY NEIGHBOUR AND 10' because of last character in mask is 'c' (could be 'C' also) - this partially match delphi , but delphi does not upper case text like it should |
|
(0016073)
Boguslaw Brandys (reporter)
2007-11-11 20:35
|
This above is default behavior, as much as possible compatible with delphi , but you could also define :
{$define MaskRaiseException}
then some previously valid mask + value combination 9due to forced compatibility with delphi) will raise exception , for example :
Test2,Test3,Test5 in test suite.
like:
AssertEquals('(123)_ - ', FormatMaskText('(000)_000-0000;0;*','123'));
not valid because 0 at position 7 *require* numeric character only but value length is exhausted ! |
|
(0016074)
Boguslaw Brandys (reporter)
2007-11-11 21:28
|
And finally fixed case when there is literal in value in the same position as (another) literal is in mask , value position was not advanced andthus checks like that below was not valid:
AssertEquals('11-AB 1/1',FormatMaskText('!AA-AA A\/A;0;0','11AB 1/1')); |
|
(0016081)
Boguslaw Brandys (reporter)
2007-11-11 22:51
|
Fixed optional characters filling.
Now such assert is fine:
AssertEquals('12300',FormatMaskText('#####;0;0','123'));
in other words : optional chars in mask is filled with '0' in that case
Note:
1. For compatibility with delphi also required chars are filled so such test is valid (when MaskRaiseException is not set)
AssertEquals('12300',FormatMaskText('0000;0;0','123'));
2. Mask should be passed with all fields filled !
This is delphi equivalent for example :
'0000;0; ' <-- notice space used in last field (delphi had a bug ignoring that field, lazarus is using it :)
Please apply this version to the repository for better bugs handling. It's quite complete (for single byte strings of course) |
|
(0016085)
Paul Ishenin (developer)
2007-11-12 08:29
|
We should decide what to do with MaskUtils. It is more RTL unit than LCL. |
|
(0016093)
Boguslaw Brandys (reporter)
2007-11-12 10:38
|
Internally converted into class, should be now thread safe. |
|
(0016123)
Boguslaw Brandys (reporter)
2007-11-13 21:26
|
Final version uploaded.I think that version would be used in TMaskEdit implementation. |
|
(0016218)
Marco van de Voort (manager)
2007-11-19 09:28
|
This one is commited afaik? Can close? |
|
(0016219)
Boguslaw Brandys (reporter)
2007-11-19 10:01
|
Yes,this bugreport can be closed.
I have no free time currently, but I will open new one as soon as I finish preliminary TMaskEdit component.Soon I hope. |
|
(0016225)
Florian Klämpfl (administrator)
2007-11-19 18:50
|
Marked as resolved according to reporter. |
|