Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0010149 [FPC] FCL feature always 2007-11-11 17:46 2008-04-13 10:41
Reporter Boguslaw Brandys View Status public  
Assigned To Florian Klämpfl
Priority normal Resolution fixed  
Status closed   Product Version
Summary 0010149: maskutils.pp unit
Description Attached zip file contains implemented maskutils.pp unit with only one function FormatMaskText.
First implementation , only for single byte AnsiStrings.

Tested on Win32, fpcunit test application included.
Additional Information
Tags No tags attached.
FPCOldBugId 0
Fixed in Revision 9375
Attached Files zip file icon maskutils.zip [^] (7,144 bytes) 2007-11-13 21:25

- Relationships
related to 0008661closedJonas Maebe Create MaskUtils unit in RTL 

-  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.

- Issue History
Date Modified Username Field Change
2007-11-11 17:46 Boguslaw Brandys New Issue
2007-11-11 17:46 Boguslaw Brandys File Added: maskutils.zip
2007-11-11 17:46 Boguslaw Brandys LazTarget => -
2007-11-11 17:46 Boguslaw Brandys Widgetset => Win32
2007-11-11 18:14 Boguslaw Brandys File Deleted: maskutils.zip
2007-11-11 18:14 Boguslaw Brandys File Added: maskutils.zip
2007-11-11 18:14 Boguslaw Brandys Note Added: 0016070
2007-11-11 18:45 Luiz Americo Issue Monitored: Luiz Americo
2007-11-11 20:10 Boguslaw Brandys File Deleted: maskutils.zip
2007-11-11 20:10 Boguslaw Brandys File Added: maskutils.zip
2007-11-11 20:24 Boguslaw Brandys Note Added: 0016072
2007-11-11 20:35 Boguslaw Brandys Note Added: 0016073
2007-11-11 20:45 Boguslaw Brandys File Deleted: maskutils.zip
2007-11-11 20:52 Boguslaw Brandys File Added: maskutils.pp
2007-11-11 21:19 Boguslaw Brandys File Deleted: maskutils.pp
2007-11-11 21:25 Boguslaw Brandys File Added: maskutils.pp
2007-11-11 21:25 Boguslaw Brandys File Added: masktests.zip
2007-11-11 21:28 Boguslaw Brandys Note Added: 0016074
2007-11-11 22:46 Boguslaw Brandys File Deleted: maskutils.pp
2007-11-11 22:46 Boguslaw Brandys File Deleted: masktests.zip
2007-11-11 22:46 Boguslaw Brandys File Added: masktest.zip
2007-11-11 22:47 Boguslaw Brandys File Added: maskutils.pp
2007-11-11 22:51 Boguslaw Brandys Note Added: 0016081
2007-11-12 08:29 Paul Ishenin LazTarget - => 0.9.26
2007-11-12 08:29 Paul Ishenin Note Added: 0016085
2007-11-12 08:29 Paul Ishenin Status new => acknowledged
2007-11-12 09:20 Vincent Snijders Relationship added related to 0008661
2007-11-12 09:50 Paul Ishenin File Added: rf_maskutils.pp
2007-11-12 10:37 Boguslaw Brandys File Deleted: masktest.zip
2007-11-12 10:37 Boguslaw Brandys File Deleted: maskutils.pp
2007-11-12 10:37 Boguslaw Brandys File Deleted: rf_maskutils.pp
2007-11-12 10:38 Boguslaw Brandys File Added: maskutils.zip
2007-11-12 10:38 Boguslaw Brandys Note Added: 0016093
2007-11-13 21:25 Boguslaw Brandys File Deleted: maskutils.zip
2007-11-13 21:25 Boguslaw Brandys File Added: maskutils.zip
2007-11-13 21:26 Boguslaw Brandys Note Added: 0016123
2007-11-14 01:11 Paul Ishenin Project Patches => FPC
2007-11-19 09:28 Marco van de Voort Note Added: 0016218
2007-11-19 10:01 Boguslaw Brandys Note Added: 0016219
2007-11-19 18:50 Florian Klämpfl Status acknowledged => resolved
2007-11-19 18:50 Florian Klämpfl Resolution open => fixed
2007-11-19 18:50 Florian Klämpfl Assigned To => Florian Klämpfl
2007-11-19 18:50 Florian Klämpfl Note Added: 0016225
2008-04-13 09:24 Jonas Maebe FPCOldBugId => 0
2008-04-13 09:24 Jonas Maebe FPCTarget => -
2008-04-13 09:24 Jonas Maebe Fixed in Revision => 9242
2008-04-13 09:24 Jonas Maebe Category LCL => FCL
2008-04-13 09:24 Jonas Maebe Fixed in Version => 2.3.1
2008-04-13 09:25 Jonas Maebe Fixed in Revision 9242 => 9375
2008-04-13 09:25 Jonas Maebe Fixed in Version 2.3.1 => 2.2.1
2008-04-13 10:41 Jonas Maebe Status resolved => closed



Mantis 1.1.1[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker