How to count the number of objects available in all the modules of a folder

Hi All,

 

 My main intention is to count the objects in a module and iterate it through a folder where i can get object count for all the modules .I tried to read a Module using the type reference  which is a string attribute. Kindly help me to resolve this out.


Santu155 - Wed Oct 03 07:19:18 EDT 2018

Re: How to count the number of objects available in all the modules of a folder
Mike.Scharnow - Wed Oct 03 14:22:08 EDT 2018

Hi, sorry, I'm too lazy to use google for you :)

So try this one:

Folder f = folder "/Test/folder"
Item i
for i in f do {
        if ("Formal" == type i) {
                Module m = read (fullName i, false, true)
                if (null m) continue
                int count=0
                Object o
                for o in entire m do count++
                print fullName m ": " count "\n"
                close m
        }
}

If you want fancy things like iterating over sub folders, sub projects, omitting deleted objects, omitting table and row objects etc.etc. you will have to use the forum search and/or DXL reference manual