Set Reference to Group Field; Assign a Value

Bruce is offline. I suggested %LocalDataFull and he came with the below code. I’m not sure how much he has tested it, I have not. Note Global and Module are not coded the same as Local, but I think it would work because %GlobalDataStatement should be blank

#FIND(%LocalDataFull, %FLabel)
#IF(%LocalData)
  #SET(%Declr, %LocalDataStatement)
  #SET(%FComment, %FComment & ' - type derived from local data')
#ENDIF
#IF(%Declr='')
  #FIND(%GlobalDataFull, %FLabel)
  #SET(%Declr, %GlobalDataStatement)
  #SET(%FComment, %FComment & ' - type derived from global data')
#ENDIF
#IF(%Declr='')
  #FIND(%ModuleDataFull, %FLabel)
  #SET(%Declr, %ModuleDataStatement)
  #SET(%FComment, %FComment & ' - type derived from module data')
#ENDIF
#IF(%Declr='')
  #FIND(%Field, %FLabel)
  #IF(%Field = %FLabel)
    #IF(SUB(%FieldType, 1, 5) = 'GROUP')
      #SET(%FComment, %FComment & ' - STRING defined to hold GROUP''s contents')
    #ELSIF(%FieldType = 'MEMO')
      #SET(%FComment, %FComment & ' - STRING defined to hold MEMO''s contents')
    #ELSE
      #SET(%FComment, %FComment & ' - type derived from field')
    #END
    #SET(%Declr, %FieldStatement)
  #ENDIF
#ENDIF