Here is my script taken from internet, it is the common way to open source module of link before beeing able to explore source objects of links :
LinkRef lr;
for lr in o<-(fullName (current Project) "/_conf/" VV_NOUVELLE_EXL_REPOND_A_EXS) do
{
ModuleVersion mvSource = sourceVersion lr
Module modSrc = data mvSource
if (null modSrc)
{
modSrc = load(mvSource, false)
// then openin the corresponding module in edit mode (I hope there is a more simple way to do this) :
modSrc = edit(fullName(modSrc), false)
[...]
The problem I have is that I need to open the module in edit mode, this is why I add : modSrc = edit(fullName(modSrc), false)
without it I can't modify the object of the source link. Be doing this I have now a baseline (current) and a module that is open, right ? so I need to close the current baseline opened using load ? (I did this after opening the module in edit mode but then I can't modify anymore the source object) or better, can I directly open the module without doing the load before ?
You can directly open source module in edit mode with following code and edit the source object.
LinkRef lref
string s
Object obj
for lref in obj<-"*"do
{
s=fullName(source(lref))
Module mod = edit(s,false)
//Do your operations here
}