[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'MaskEdit' (#lcl)

FormatMaskText

Applies an edit mask to the specified string value.

Declaration

Source position: maskedit.pp line 391

function FormatMaskText(

  const AEditMask: string;

  const Value: string;

  EnableSets: Boolean = False

):string;

Arguments

Value

  

Original content modified in the routine.

Function result

Value after applying the specified mask.

Description

FormatMaskText is a String function used to apply an edit mask to the specified String value. FormatMaskText creates a temporary instance of TCustomMaskEdit that is used to apply the edit mask in AEditMask when required. The value in AEditMask is assigned to the EditMask property in TCustomMaskEdit.

The Value argument contains the data without any mask literals, escaped characters, or space characters inserted by the editing mask. When the IsMasked method in the TCustomMaskEdit returns True, the ApplyMaskToText method is used to generate the return value for the routine. To maintain Delphi compatibility, the GetTextWithoutSpaceChar is also called to translate space characters represented using the character in the mask field to the Space character (decimal 32).

When IsMasked is False, the unmodified content in Value is used as the return value.

See also

TCustomMaskEdit.EditMask

  

Contains the mask characters classes and literals used to format/obscure the value for the control.

TCustomMaskEdit.IsMasked

  

True if a non-empty value has been assigned to EditMask.

TCustomMaskEdit.ApplyMaskToText

  

Applies the edit mask in the control to the specified value.

TCustomMaskEdit.GetTextWithoutSpaceChar

  

Gets the value for the control without the Space character literal used in the edit mask.


Version 3.2 Generated 2024-02-25 Home