问题描述
我是DXL新手,正在尝试使用Module_X中的布局DXL来显示基于Module_Y中链接属性值的文本输出。
Module_X具有多个出站链接,其中之一是Module_Y。我想从Module_Y读取的属性称为Version_number,并且是从“版本1”到“版本6”的枚举范围。
如果链接的版本大于版本3,则我想在Module_X中运行的布局DXL中输出“是”文本字符串。 Module_X中的每个对象可能具有多个链接的version_number。在Module_X和Module_Y之间总共有5个跃点。
我试图通过分析向导来执行此操作,以显示链接的version_number属性,此操作成功。 但是我不确定如何处理“如果version_number的值包含> Version_3”元素。 感谢您的帮助,如果需要进一步说明此问题,请告诉我。
void showOut(Object o,int depth) {
Link l
LinkRef lr
ModName_ otherMod = null
Module linkMod = null
ModuLeversion otherVersion = null
Object othero
string disp = null
string s = null
string plain,plaindisp
int plainTextLen
int count
bool doneOne = false
string linkModName = "*"
for l in all(o->linkModName) do {
otherVersion = targetVersion l
otherMod = module(otherVersion)
if (null otherMod || isDeleted otherMod) continue
if (!equal(getItem otherMod,(itemFromID limitModules[depth-1]))) continue
if (versionString(otherVersion) != limitVersions[depth-1]) continue
othero = target l
if (null othero) {
load(otherVersion,false)
}
othero = target l
if (null othero) continue
if (isDeleted othero) continue
int oldLines = lines[depth-1]
adjustLines(depth,4)
bool kick = (doneOne) && (lines[depth-1] == oldLines)
if (kick) {
lines[depth-1]++
if (depth == 4) displayRich("\\pard " " ")
}
if (depth < 4) {
showOut(othero,depth+1)
}
doneOne = true
if (depth == 4) {
s = probeRichAttr_(othero,"Version_number",false)
if (s == "")
displayRich("\\pard " " ")
else
displayRich("\\pard " s)
}
lines[depth-1] += 1
}
} showOut(obj,1)
解决方法
s = probeRichAttr_(othero,"Version_number",false)
if (s == "")
displayRich("\\pard " " ")
elseif(intOf(s[8])>3)
displayRich("\\pard " s)
,
感谢您的输入。最后,由于任务的更改,“仅链接”部分没有相关性,因此此代码可以有效地解决问题。
非常感谢:-)