Community articleGetLiteralEx 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 retrieves the literal of a node. The literal is returned in the specified character set.
Note: It is not necessary to call this function when you are using XForms. Use the ExtractXFormsInstance function instead.


   Function GetLiteralEx(
      theCharSet As String
      ) As String


Table 1. Function parameters
theCharSetStringThe character set you want to use to view the literal string. Use null for ANSI/Unicode.


A string containing the literal of the node or throws an exception if an error occurs. If the literal is empty or does not exist, the function returns null.


The following function copies the value from one field to another. First, the function uses DeferenceEx to locate the value node of a field on page one and reads the value using GetLiteral. Next, the function locates a value node on page two and writes the literal to that field using SetLiteral.
   Sub CopyValue(Form)
      Dim TempNode  ' object
      Dim theName  ' string
      Set TempNode = Form
      ' Locate the NameField on page 1
      Set TempNode = TempNode.DereferenceEx(vbNullString, _
         "PAGE1.NameField.value", 0, UFL_OPTION_REFERENCE, Nothing)
      ' Get the literal from the value node
      theName = TempNode.GetLiteralEx
      ' Locate the NameField on page 2
      Set TempNode = TempNode.DereferenceEx(vbNullString, _
         "PAGE2.NameField.value", 0, UFL_OPTION_REFERENCE, Nothing)
      ' Write the literal that was read from the first value node
      TempNode.SetLiteral theName
   End Sub

Parent topic:
FormNodeP functions