Cannot load Link Module

Hello,

I've written a script to copy links from one module to another.
The problem is that sometimes I get the error : "cannot load module 'link module name' "

Link l
                                    for l in srcObj<-"*" do
                                    {
                                        Module lnkMod     = module l
                                            string lnkModName = lnkMod."Name"
                                            Object s          = source l

                                            if ( canWrite(s) )
                                            {
                                            
                                                if(isDeleted(trgObj))
                                                {
                                                    continue
                                                }

                                                    //create link
                                                s -> lnkModName -> trgObj
                                                    numIns++



                                            }

Could someone tell the cause of that error?
Best regards!


dxlBeginner - Fri Dec 19 05:04:42 EST 2014

Re: Cannot load Link Module
Tony_Goodman - Fri Dec 19 05:57:27 EST 2014

Try using fullName(lnkMod) instead of lnkMod."Name".

 

Tony

 

Re: Cannot load Link Module
dxlBeginner - Fri Dec 19 07:21:06 EST 2014

Tony_Goodman - Fri Dec 19 05:57:27 EST 2014

Try using fullName(lnkMod) instead of lnkMod."Name".

 

Tony

 

Thank you!

Tthat was the solution!

Mohamed

Re: Cannot load Link Module
llandale - Tue Jan 06 20:15:51 EST 2015

Tony_Goodman - Fri Dec 19 05:57:27 EST 2014

Try using fullName(lnkMod) instead of lnkMod."Name".

 

Tony

 

Yes.  "Name" is unqualified, in this case someone created link module named 'link module name'.  Unqualified names default to the "current" folder (the one containing the module running the script), and it is likely the link module is in some other folder; thus doors cannot resolve the name.  Routinely use fullNames when refering to actual modules.

-Louie