[Lazarus] Attn José: TWindowsMask oddity?

José Mejuto joshyfun at gmail.com
Mon Nov 1 12:21:16 CET 2021


El 31/10/2021 a las 17:12, Bart via lazarus escribió:
> Hi José,
> 
> In TWindowsMask.Compile (as in your TMaskUTF8Windows class) you do a
> call to EscapeSpecialChars on the modified mask.
> This will escape a.o. any '[' and ']'  character, so ranges and sets
> are not possible to use in the mask anymore.
 > Why did you disable ranges and sets in the Windows implementation?

Hello,

The target in *Windows classes is to mimic the old fashion CMD masks, 
and CMD masks does not have ranges or sets.

When I implemented that fnuction the code does not allow disabling 
features, so now that code can be changed to disable ranges, sets and 
escape char instead escaping the chars.

> And another question: why do you call Compile in the constructor for
> TWindowsMask (TMaskUTF8Windows in your original)?

LCL's TMask raises syntax errors (or others, I can not recall) at 
creation time and in my code the syntax check is at Compile time so I 
call compile to raise an exception if needed. There is no performance 
loss as Compile should not be called again unless the mask is changed 
via the property.

-- 



More information about the lazarus mailing list