Community articleGetIdentifier function
Added by IBM contributorIBM on July 26, 2013
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars


This function retrieves the identifier of a node. This is either the scope identifier or the option name for the node.


Function GetIdentifier() As String


There are no parameters for this function.


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


The following function locates the first value option in a single page form, and assumes that you pass it the root node of the form. First, the function uses GetChildren and GetNext to locate the first item in the first page. The function then uses nested loops and GetNext to iterate through each option for each item in the form, testing each option with GetIdentifier until it locates a value node. Finally, the function returns the value node, or a null node if no value node was found.
   Function LocateFirstValue(Form)
      Dim ItemNode, OptionNode  ' objects
      Dim Found  ' Boolean
      Set ItemNode = Form
      Found = False
      ' Find the first item on the first page of the form. This takes three
      ' separate calls, since we do not know the name of the first page or
      ' item.
      Set ItemNode = ItemNode.GetChildren
      Set ItemNode = ItemNode.GetNext
      Set ItemNode = ItemNode.GetChildren
      ' Iterate through the items until one is found that contains a value
      ' option or a null node is reached.
      Do While (Not(ItemNode is Nothing))
         ' Find the first option in the current item.
         Set OptionNode = ItemNode.GetChildren
         ' Iterate through the options until a "value" option is found or a
         ' null node is reached.
         Do While (Not(OptionNode is Nothing))
            If OptionNode.GetIdentifier= "value" Then
               Found = True
               Exit Do
            End If
            Set OptionNode = OptionNode.GetNext
         If Found Then Exit Do
         Set ItemNode = ItemNode.GetNext
      Set LocateFirstValue = OptionNode
   End Function

Parent topic:
FormNodeP functions