使用 DXL:link 在编辑模式下的开源模块
using DXL : open source module of a link in edit mode
这是我从互联网上获取的脚本,这是在能够探索 link 的源对象之前打开 link 的源代码模块的常用方法:
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)
[...]
我遇到的问题是我需要在编辑模式下打开模块,这就是我添加的原因:
modSrc = edit(全名(modSrc), false)
没有它我无法修改源 link 的对象。
这样做我现在有一个基线(当前)和一个打开的模块,对吗?
所以我需要关闭使用 load 打开的当前基线? (我在编辑模式下打开模块后这样做了,但是我不能再修改源对象了)
或者更好,我可以不做加载直接打开模块吗?
您可以使用以下代码在编辑模式下直接打开源模块并编辑源对象。
LinkRef lref
string s
Object obj
for lref in obj<-"*"do
{
s=fullName(source(lref))
Module mod = edit(s,false)
//Do your operations here
}
这是我从互联网上获取的脚本,这是在能够探索 link 的源对象之前打开 link 的源代码模块的常用方法:
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)
[...]
我遇到的问题是我需要在编辑模式下打开模块,这就是我添加的原因: modSrc = edit(全名(modSrc), false)
没有它我无法修改源 link 的对象。 这样做我现在有一个基线(当前)和一个打开的模块,对吗? 所以我需要关闭使用 load 打开的当前基线? (我在编辑模式下打开模块后这样做了,但是我不能再修改源对象了) 或者更好,我可以不做加载直接打开模块吗?
您可以使用以下代码在编辑模式下直接打开源模块并编辑源对象。
LinkRef lref
string s
Object obj
for lref in obj<-"*"do
{
s=fullName(source(lref))
Module mod = edit(s,false)
//Do your operations here
}