Issue with EditMask, variable length number exception lazarus / 31-LCL ---------------------------------------------------------------------- Knipfty · 2012-08-18 13:54 Hi All/Bart, {Bart I saw on thread where you said you were the unofficial maintainer of EditMask} I have a DB field using a EditMask defined as !###,###,##0.00;0;_ If I enter a value such as 550000, it raises a exception that the value entered doesn't match the editmask.  So my question is how do I construct a editmask  that will format variable length of digits and groups the digits in 3s. I did some searching on http://www.freepascal.org, and while it lists it as a property of TFeild, it didn't go into any specifics.  I was able to construct the above by playing with the component and some other threads. Thanks Knipfty ---------------------------------------------------------------------- Bart · 2012-08-18 21:33 550000 fails because the mask expects a number in the last three places, so 550000.00 will do. Unfortunately MaskEdit isn't very well designed to handle variable length strings. You could use a mask of !###,###,###.##;0;_ You could also use the OnExit event to force the current content to comply with the mask, for instance replace all rubbish with '0' and then remove leading spaces, stopping at the last digit before the decimal point (b.t.w. this won't work on delphi, since there validating is done before OnExit is called). Ideally for this kind of job we would have some control like MaskEdit, but the content being controlled by a regular expression instead of a mask. Bart ---------------------------------------------------------------------- Knipfty · 2012-08-18 22:19 Thanks Bart, you gave me enough to work on. Knipfty