Formatting

In addition to the standard formatting features you can define script formatters. These are displayed as objects in the project script and fire an event that lets you format a field’s text to your custom format. There are three options for the type of the formatter: Date, Double, and Text. Depending on the type, a different event is fired.


A visual example of the Script Formatter Event.

Private Sub MyFormatter_FormatField(ByVal FieldText As String, FormattedText As String, ErrDescription As String, ValidFormat As Boolean)

The parameter FieldText is the field's text before the formatting is applied, whereas FormattedText contains the formatted text. Put to the parameter ErrorDescription the message that is displayed to the user in Validation. Set the flag ValidFormat to decide if the script formatting failed or not.

Private Sub Formatting_FormatDoubleField(ByVal FieldText As String, FormattedText As String, ErrDescription As String, ValidFormat As Boolean, ByRef DoubleVal As Double, ByRef DoubleFormatted As Boolean)

The parameter FieldText is the field's date before the formatting is applied, whereas FormattedText contains the formatted date. Put to the parameter ErrorDescription the message that is displayed to the user in Validation. Set the flag ValidFormat to decide if the script formatting failed or not. The DateVal parameter contains the date value of the field if the date formatting succeeded and the flag DateFormatted is reflecting if the DateVal is set.

Private Sub Formatting_FormatDateField(ByVal FieldText As String, FormattedText As String, ErrDescription As String, ValidFormat As Boolean, ByRef DateVal As Date, ByRef DateFormatted As Boolean)

The parameter FieldText is the field's double value before the formatting is applied, whereas FormattedText contains the formatted value. Put to the parameter ErrorDescription the message that is displayed to the user in Validation. Set the flag ValidFormat to decide if the script formatting failed or not. The DoubleVal parameter contains the double value of the field if the date formatting succeeded and the flag DoubleFormatted is reflecting if the DoubleVal is set.