Category, Field and Connection Objects

vbScript Example:
 '
 ' Get the category definitions out of the database and loop through
 '  them.
 '
 dim cdefs: set cdefs = dfrm.DB.categoryDefs
 dim i: for i = 0 to cdefs.count - 1

   '
   ' Pick one of the category definitions
   '
   dim cdef: set cdef = cdefs.get(i)
   ddll.debug cdef.name

   '
   ' Grab the field definitions out of this selected category
   '  and print their contents
   '
   dim fdefs: set fdefs = cdef.fieldDefs
   dim j: for j = 0 to fdefs.count - 1
     dim fdef: set fdef = fdefs.get(j)
     ddll.debug "  " & fdef.name
   next

   '
   ' Grab the connection definitions out of this selected category
   '  and print their contents
   '
   dim condefs: set condefs = cdef.connectionDefs
   for j = 0 to condefs.count - 1
     dim condef: set condef = condefs.get(j)
     ddll.debug "  " & condef.name & "->" & condef.toCategory

     '
     ' Grab back to the target category and print some stuff out
     '  of it.
     '
     dim conCatDef: set conCatDef = condef.getCategoryDef
     ddll.debug "    cat: " & conCatDef.name
     ddll.debug "    fld: " & conCatDef.fieldDefs.count
     ddll.debug "    con: " & conCatDef.connectionDefs.count

   next

 next




~ ~ ~ ~ ~ ~
Source Code without Comments is like a Cranberry Garland
without the berries. Comment your Code!
 
Commence Database User Support Group Forum
http://newsgroup.showoff-db.org/
~ ~ ~ ~ ~ ~
Author: Mark Petryk
Lorimark Solutions, LLC
mark@lorimarksolutions.com