Community articleIsValidFormat function
Added by IBM contributorIBM on August 15, 2011
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.


This function returns the boolean result of whether a string is valid according to the setting of the node's format option.


   Function IsValidFormat(
      theString As String
      ) As Boolean


Table 1. Function parameters
A string to be checked against the format. For example, to check 23.2 against a specific format, the string would be “23.2”.


True if the string does match the format, False if it does not.


The following function locates the Currency field and checks to see if “23.2” conforms to the format required by the field's format option.
   Sub CheckFormat(TheForm)
      Dim theItem ' object
      ' Locate the Currency field
      Set theItem = TheForm.DereferenceEx(vbNullString, _
         "PAGE1.Currency", 0, UFL_OPTION_REFERENCE, Nothing)
      ' Check the string to see if it is valid. If it is valid, then
      ' enter the string into the Currency field.
      ' Otherwise, do nothing.
      If theItem.IsValidFormat("23.2") = True Then
      theItem.SetLiteralByRefEx vbNullString, "value", 0, vbNullString, Nothing, _ 
      End If
   End Sub

Parent topic:
FormNodeP functions